首页 > 其他 > 详细

alertview 使用

时间:2014-11-22 01:58:08      阅读:289      评论:0      收藏:0      [点我收藏+]

typedef enum{

alertviewType1,

alertviewType2,

} alertviewType;

 

@interface ZBMainViewController ()<UIAlertViewDelegate>

 

@end

 

@implementation ZBMainViewController

 

 

 

 

- (void)viewDidLoad

{

    [super viewDidLoad];

    

    //导航栏是否透明  no是透明

    

    [self.navigationController.navigationBar setTranslucent:NO];

 

     self.navigationItem.title = @"张先森";   //    self.title=@"张先森";

    

    [self.navigationController.navigationBar setBarTintColor:[UIColor purpleColor]];

 

 

    [self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:@"测试" style:UIBarButtonItemStyleDone target:self action:@selector(leftClick:)]];

}

 

-(void)leftClick:(UIBarButtonItem *)item{

    UIAlertView *view=[[UIAlertView alloc] initWithTitle:@"测试" message:@"你大爷" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"yes", nil];

     view.tag=alertviewType1;

    [view show];

}

 

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

 

    if (alertView.tag==alertviewType1) {

        

        if (buttonIndex==0) {

            

        }

        

        

        

    }

 

 

}

 

alertview 使用

原文:http://www.cnblogs.com/zhibin/p/4114554.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!