IOS 开发学习32 actionSheet的使用
2015-06-04 10:17
411 查看
头文件
@interface sheetviewViewController : UIViewController<UIActionSheetDelegate> @end
弹出actionSheet
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:_str_title delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:nil]; [actionSheet addButtonWithTitle:@"一个选项"]; actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque; [actionSheet showInView:self.view];
定义重写方法
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex<1)return; } - (void)actionSheetCancel:(UIActionSheet *)actionSheet{ NSLog(@"cancel"); } -(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ NSLog(@"didDismiss"); } -(void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex{ NSLog(@"willDismiss"); }
相关文章推荐
- ios 怎样让textview里的文字从最顶开始显示?
- iOS手动旋转屏幕、自动旋转屏幕
- 【我们都爱Paul Hegarty】斯坦福IOS8公开课个人笔记28 ScrollView 滑动视图
- IOS开发之AVAudioPlayer
- iOS的hook方案: Method Swizzling
- ios修改导航条title的颜色
- facebook 开源的一个 移动开发框架
- JS对于Android和IOS平台的点击响应的适配
- 构建 iOS 风格移动 Web 应用程序的8款开发框架
- ios开发学习笔记040-autolayout 第三方框架Masonry
- IOS开发中的几种设计模式介绍
- iOS应用开发:什么是ARC?
- 1000 个 iOS 常用的库
- [转]IOS开发中四种解析Json的方法
- xcode6.3 模版位置
- IOS8中Corelocation调用修改
- BIOS基本知识
- iOS图片的截取(OC)
- iOS开发—iOS多线程编程之NSThread的使用
- iOS日期与时间处理