UIAlertView弹出框
2015-11-26 22:56
453 查看
<Alert弹出框提示用户信息>
1.遵循代理方法<UIAlertViewDelete>
2.调用方法UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"恭喜通关!" message:@"更多精彩,请购买下一关~~" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"购买",@"购买1",@"购买2",nil];
alert.tag = 10;
[alert show];
3.点击第几个按钮根据ButtonIndex 传值 调用代理方法(设置tag就是有多个alertView ,根据这个判断)
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{ NSLog(@"%d",alertView.tag);
NSLog(@"%d",buttonIndex);
if (buttonIndex == 1) { // 点击了购买按钮
NSLog(@"点击了购买按钮"); }
}
1.遵循代理方法<UIAlertViewDelete>
2.调用方法UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"恭喜通关!" message:@"更多精彩,请购买下一关~~" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"购买",@"购买1",@"购买2",nil];
alert.tag = 10;
[alert show];
3.点击第几个按钮根据ButtonIndex 传值 调用代理方法(设置tag就是有多个alertView ,根据这个判断)
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{ NSLog(@"%d",alertView.tag);
NSLog(@"%d",buttonIndex);
if (buttonIndex == 1) { // 点击了购买按钮
NSLog(@"点击了购买按钮"); }
}
相关文章推荐
- Android Uiautomator工具使用
- UIActionSheet底部弹出框
- IOS之UILabel添加下划线
- GUI Frame(一)
- iPhone的UITextField-更改占位符文本颜色
- SPOJ LIS2 Another Longest Increasing Subsequence Problem 三维偏序最长链 CDQ分治
- mybatis:java.lang.IllegalArgumentException:Parameter Maps collection does notcontain value for ...
- 读书笔记--其他UI组件
- 108 Which two statements are true about the Automatic Diagnostic Repository (ADR)? (Choose two.) A.
- UIScrollView视差模糊效果
- Android官方文档翻译 五 1.3Building a Simple User Interface
- QUESTION 105 Examine the following RMAN script: RMAN> run { debug on; allocate channel c1 type disk;
- UI错误集
- 基于GUI的简易图像处理系统设计与实现
- UIView设置圆角、边框和阴影
- UITextFieldDelegate协议中各个方法调用情况
- 606第七周周赛 C - Wavio Sequence最长递增递减序列
- Auto Layout 使用心得(五)—— 根据文字、图片自动计算 UITableViewCell 高度
- 深入理解dispatch_queue
- UI-Target-action模式