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

UIAlertView 使用及按钮响应事件

2015-09-09 12:53 423 查看
-(void)addLable

{

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认",nil];

alert.alertViewStyle = UIAlertViewStylePlainTextInput;

UITextField *nameField = [alert textFieldAtIndex:0];

nameField.placeholder = @"请输入标签名称";

[alert show];

}

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

{

if (buttonIndex==0) {

NSLog(@"你点击了取消");

}else if (buttonIndex==1){

switch (IlableNum) {

case 0:

NSLog(@"你点击了确定");

_addLableOne.text = @"文本改变";

break;

default:

break;

}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: