UIActionSheet
2016-01-12 22:44
295 查看
UIActionSheet是在iOS弹出的选择按钮项,可以添加多项,并为每项添加点击事件。
-(IBAction)sheetshow:(id)sender{
UIActionSheet *sheetnow=[[UIActionSheet alloc]initWithTitle:@"相片设置功能" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"相片移除" otherButtonTitles:@"确认", nil];
[sheetnow showInView:self.view];
}
//代理
<UIActionSheetDelegate>
//代理方法
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
NSLog(@"%ld",buttonIndex);
if (buttonIndex==1) {
UIImageView *view=[[UIImageView alloc]initWithFrame:self.view.frame];
view.backgroundColor=[UIColor blackColor];
[self.view addSubview:view];
}
}
-(IBAction)sheetshow:(id)sender{
UIActionSheet *sheetnow=[[UIActionSheet alloc]initWithTitle:@"相片设置功能" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"相片移除" otherButtonTitles:@"确认", nil];
[sheetnow showInView:self.view];
}
//代理
<UIActionSheetDelegate>
//代理方法
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
NSLog(@"%ld",buttonIndex);
if (buttonIndex==1) {
UIImageView *view=[[UIImageView alloc]initWithFrame:self.view.frame];
view.backgroundColor=[UIColor blackColor];
[self.view addSubview:view];
}
}
相关文章推荐
- UIAlertView(警告提示)
- UINavigationController(导航控制器)
- UIView
- UIActivityIndicatorView(菊花)
- Values of attribute "level" not equal in different manifest snippets.
- 第一天接触ui感觉有点乱啊,今天只有笔记,明天复习敲完代码在发代码
- UIButton
- iOS UIImageView
- 198,自定义UITableViewCell(一)
- Errors occurred during the build.
- gnuradio入门-基于GUI的FM接收机的实现
- 、UIDynamic介绍
- UIAlertController 的使用——NS_CLASS_AVAILABLE_IOS(8_0)
- 前端开发入门:vue.js
- 修改基于zxing库的cordova扫描二维码插件BarcodeScan扫码界面的UI
- UEditor 1.4.3.1.NET版本上传配置备忘录
- 关于CALayer及其和UIView的区别与选择
- iOS开发- iOS7显示偏差(UITableView下移)解决的方法
- Volley中RequestQueue对request的add优化处理
- iOS UI-应用管理(使用Cell模板)