码迷,mamicode.com
首页 > 其他好文 > 详细

UIAlertView弹出框

时间:2015-11-27 00:41:00      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:

<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(@"点击了购买按钮");   }
    }

UIAlertView弹出框

标签:

原文地址:http://www.cnblogs.com/mawenqiangios/p/4999320.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!