iOS开发基础 - UIActionSheet
2012-04-18 00:05
351 查看
UIActionSheet是一个非常常用的UIView,可以放置多个操作按钮并通过UIActionSheetDelegate委托实现一些方法。在这里只是一些基本简单的应用和讲解,以后如果遇到更深层次的应用将会补充上。
2012-4-28
Apple官网文档地址: UIActionSheet Class Reference 、UIActionSheetDelegate Protocol Reference
例子:可以在一个消息中,创建一个UIActionSheet
通常在使用UIActionSheet过程中需要使用UIActionSheetDelegate委托,一般需要实现- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;这个方法。
2012-4-28
Apple官网文档地址: UIActionSheet Class Reference 、UIActionSheetDelegate Protocol Reference
例子:可以在一个消息中,创建一个UIActionSheet
UIActionSheet *actT=[[UIActionSheet alloc] initWithTitle: @"title" delegate: self cancelButtonTitle: @"Cancel" destructiveButtonTitle: @"ImageFormAlbum" otherButtonTitles: @"ImageFomrCamera",nil];//创建一个UIActionSheet对象 [actT setActionSheetStyle:UIActionSheetStyleBlackTranslucent];//设置ActionSheetStyle [actT showInView:self.appMy.skRt.view];//将UIActionSheet对象添加父视图中 [actT release];
通常在使用UIActionSheet过程中需要使用UIActionSheetDelegate委托,一般需要实现- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;这个方法。
#pragma mark - #pragma mark UIActionSheet - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ switch (buttonIndex) { case 0:{ //To do something } break; case 1:{ //To do something } break; default: break; } }
相关文章推荐
- iOS开发之基础视图—— UIActionSheet
- 【IOS 开发学习总结-OC-47】★ios开发之UI控件——UIAlertView与 UIActionSheet
- iOS开发 对话框UIActionSheet和UIAlertView用法
- IOS开发之自定义UIActionSheet
- IOS开发-UIActionSheet
- IOS开发UI篇之──自定义UIActionSheet
- UIActionSheet操作表单-IOS开发
- UIActionSheet操作表单-IOS开发
- iOS开发 对话框UIActionSheet和UIAlertView用法
- IOS开发UI篇之──自定义UIActionSheet【转】
- IOS 开发学习十六 UIActionSheet的使用
- iOS开发-UIActionSheet和UIAlertController
- iOS开发-UIActionSheet简单介绍
- iOS开发之自定义系统的UIActionSheet修改按钮的属性
- 学习IOS开发UI篇--UIAlertView/UIActionSheet
- iOS开发之如何自定义UIActionSheet(UIAlertView)中的内容
- IOS基础UI之(五)UIAlertView、UIActionSheet和UIAlertController详解
- iOS开发笔记-UIActionSheet的相关属性设置
- iOS UI基础-6.0 UIActionSheet的使用
- IOS开发之自定义UIActionSheet