Android 自定义弹出框实现代码
2016-08-16 11:14
639 查看
废话不多说了,直接给大家上关键代码了。
- (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自定义弹出框实现方式(dialog)
- Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上2种经典解决方法。
- Android ImageButton自定义按钮的按下效果的代码实现方法
- Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上2种经典解决方法。
- 学习Android之第四个小程序猜拳(代码实现MENU、自定义对话框)
- Android中ImageButton自定义按钮的按下效果的代码实现方法
- android自定义dialog实现下拉弹出框效果
- Android ImageButton自定义按钮的按下效果的代码实现方法分享
- Android代码实现自定义Button
- Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上2种经典解决方法。 2014-07-04 13:17 78人阅读 评论(0) 收藏
- 自定义弹出框实现02-拖到弹出框代码实现
- android自定义弹出框样式实现
- Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上2种经典解决方法
- android自定义弹出框样式实现
- Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上2种经典解决方法。
- 重写android.app.ProgressDialog实现自定义进度条弹出框布局
- android 自定义ListView 实现 弹出自定义对话框(带EditText)实现 配置文件实现
- Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上2种经典解决方法。
- android 自定义ScrollView实现背景图片伸缩的实现代码及思路
- android 自定义ScrollView实现背景图片伸缩的实现代码及思路