//
// UIAlertViewController.m
// AppUI组件学习
//
// Created by 麦子 on 15/6/18.
// Copyright (c) 2015年 麦子. All rights reserved.
//
#import "UIAlertViewController.h"
@interface UIAlertViewController ()
@end
@implementation UIAlertViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor blackColor];
[self createView:self.view];
}
- (void)createView:(id)uiView{
UIView *view = (UIView *)uiView;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"用户名或密码不对" delegate:self cancelButtonTitle:@"是" otherButtonTitles:@"否", nil];
[view addSubview:alert];
[alert show];
alert.delegate = self;
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0) {
NSLog(@"你点击了是");
}else if (buttonIndex == 1){
NSLog(@"点击了否");
}
}
@end
UIAlertView
最新推荐文章于 2021-01-30 12:03:24 发布