您的位置:首页 > 产品设计 > UI/UE

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(@"点击了购买按钮"); }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: