IOS问题汇总:2012-12-18 UIAlertView+UIActionSheet
2015-04-14 16:11
120 查看
UIAlertView/UIActionSheet
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@“添加场景模式” message:@“请输入场景名称” delegate:self cancelButtonTitle:@“取消” otherButtonTitles:@“确定”, nil];alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
UITextField * tf = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, alertView.frame.size.width, 44)];
tf.borderStyle = UITextBorderStyleRoundedRect; /* UITextBorderStyleNone, UITextBorderStyleLine, UITextBorderStyleBezel, UITextBorderStyleRoundedRect*/ // tf.placeholder = detailText; // NSLog(@"tf.text--%@",tf.text); // tf.delegate = self; // tf.borderStyle = UITextBorderStyleRoundedRect; [alertView addSubview:tf]; [alertView show];
——alertView自动消失
-(void) performDismiss:(NSTimer *)timer
{
[Alert dismissWithClickedButtonIndex:0 animated:NO];
[Alert release];
}
-(void)presentSheet
{
Alert = [[UIAlertView alloc] initWithTitle:@“警告” message:@“出错啦!” delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
[NSTimer scheduledTimerWithTimeInterval:2.0f target:self selector:<a href="http://www.twitter.com/selector">@selector</a>(performDismiss:) userInfo:nil repeats:NO]; [Alert show];
}
UIActionSheet *as = [[UIActionSheet alloc]initWithTitle:[NSString stringWithFormat:@“添加%@”,actionSheetTitle] delegate:self cancelButtonTitle:@“取消” destructiveButtonTitle:nil otherButtonTitles:actionSheetButtonTitle ,nil];
/* UIActionSheetStyleAutomatic = -1, // take appearance from toolbar style otherwise uses 'default' UIActionSheetStyleDefault = UIBarStyleDefault, UIActionSheetStyleBlackTranslucent = UIBarStyleBlackTranslucent, UIActionSheetStyleBlackOpaque = UIBarStyleBlackOpaque, */ // as.actionSheetStyle = UIActionSheetStyleBlackOpaque; [as showInView:self.view];
相关文章推荐
- IOS开发问题解决之UIAlertView调用UIActionSheet后灰色背景一直存在
- IOS开发问题解决之UIAlertView调用UIActionSheet后灰色背景一直存在
- ios-UIAlertView,UIActionSheet-常用方法
- IOS学习笔记(九)之UIAlertView(警告视图)和UIActionSheet(操作表视图)基本概念和使用方法
- ios-day05-05(创建弹框(对话框),UIAlertView、UIActionSheet)
- 学习IOS开发UI篇--UIAlertView/UIActionSheet
- IOS学习笔记(九)之UIAlertView(警告视图)和UIActionSheet(操作表视图)基本概念和使用方法
- UIAlertController的使用(ios9.0后代替UIAlertView与UIActionSheet)
- IOS笔记之UIKit_UIAlertView、UIActionSheet
- iOS:简单使用UIAlertVIew和UIActionSheet
- iOS 8 中 UIAlertView 和 UIActionSheet 河里去了?
- IOS UIAlertController 弹框 (ios 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)
- iOS UIAlertController 弹框 (ios 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)
- UIAlertView及UIActionSheet 在ios8极其以下版本的兼容问题解决方案
- ios 9.0 后用UIAlertController代替了UIAlertView弹框 和 UIActionSheet下弹框
- 【IOS 开发学习总结-OC-47】★ios开发之UI控件——UIAlertView与 UIActionSheet
- iOS开发 提示框- UIAlertController(是UIAlertView和UIActionSheet的合二为一)
- iOS 弹窗UIAlertView、UIActionSheet、UIAlertController简述 —— HERO博客
- iOS开发之如何自定义UIActionSheet(UIAlertView)中的内容