雅典奥运会闭幕式中国8分钟,网络 测速,今日成品油价格
废话不多说了,直接给大家上关键代码了。
- (void)viewdidload { [super viewdidload]; // do any additional setup after loading the view. [self showalertview:@"11111"]; } //自定义弹出框 -(void)showalertview:(nsstring *)strtiptext { uiview *showview=[[uiview alloc]init]; [showview setframe:cgrectmake(100, 100, 120, 35)]; [showview setalpha:0.0f]; [showview setbackgroundcolor:[uicolor blackcolor]]; [showview setclipstobounds:yes]; [[showview layer]setmaskstobounds:yes]; [[showview layer]setcornerradius:5.0f]; uilabel *lbltips=[[uilabel alloc]init]; [lbltips setframe:cgrectmake(0, 0, 120, 35)]; [lbltips settext:strtiptext]; [lbltips settextalignment:nstextalignmentcenter]; [lbltips settextcolor:[uicolor whitecolor]]; [lbltips setbackgroundcolor:[uicolor clearcolor]]; [lbltips setfont:[uifont boldsystemfontofsize:16]]; [showview addsubview:lbltips]; [self.view addsubview:showview]; [uiview animatewithduration:0.5f delay:0.0f options:uiviewanimationoptioncurvelinear animations:^{ showview.alpha=1.0f; }completion:^(bool finished){ [uiview animatewithduration:1.0f delay:1.0f options:uiviewanimationoptioncurvelinear animations:^{ showview.alpha=0.0f; }completion:^(bool finished){ ; }]; }]; }
以上所述是小编给大家介绍的android 自定义弹出框实现代码,希望对大家有所帮助
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Android studio开发小型对话机器人app(实例代码)
Android通过Java sdk的方式接入OpenCv的方法
Android 通过cmake的方式接入opencv的方法步骤
Android Studio finish()方法的使用与解决app点击“返回”(直接退出)
Android 进度条 ProgressBar的实现代码(隐藏、出现、加载进度)
网友评论