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;
}
}
}
{
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;
}
}
}
相关文章推荐
- Android中Service标签提示Exported service does not require permission警告
- Atitit.Gui控制and面板----db数据库领域----- .比较数据库同步工具 vOa
- 安装RPM套件rpm-build错误解决:NOKEY、elfutils is needed
- ue不在打开方式中解决方法
- Android 多线程编程:Handler消息传递机制—刷新UI主界面
- angular-ueditor修正版发布
- Lync Server 2013 Prerequisite installation failed 推荐
- LINQ语句中的.AsEnumerable() 和 .AsQueryable()的区别
- 理解Android中dpi和分辨率的关系,谈谈Android做成适应全部手机的UI方式
- quick中触摸事件响应机制
- keychain + uuid != uuid
- iOS开发之UITextView,设置textViewplaceholder
- iOS开发之UITextView,设置textViewplaceholder
- easyui filebox 浏览图片
- 163邮件出错:不允许使用邮箱名称。 服务器响应为: authentication is required,smtp7,C8CowEDpS0+Uke9VvSmXBg--.546S2 1441763733
- 文件的特殊权限:SUID SGID SBIT
- select, iocp, epoll,kqueue及各种I/O复用机制
- Leetcode 115 Distinct Subsequences 解题报告
- iOS UINavigationController与UITabBarController的组合使用
- 开源项目分析之UIL(续)