【iOS学习】十一、ActionSheet
来源:互联网 发布:淘宝便宜的衣服能买吗 编辑:程序博客网 时间:2024/06/06 17:11
ActionSheet
(1)实现协议
在头文件中遵守UIActionSheetDelegate协议。
@interface ActionSheetTest : UIView<UIActionSheetDelegate>
(2)定义
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:nil // 标题delegate:self // 代理cancelButtonTitle:@"取消" // 取消,系统自带 destructiveButtonTitle:nil // 确定,系统自带otherButtonTitles:@"是",@"否", nil]; // 自定义其它选项// actionSheet的样式// UIActionSheetStyleBlackOpaque 不透明的深色样式// UIActionSheetStyleBlackTranslucent 半透明的深色样式// UIActionSheetStyleAutomatic 如果屏幕底部有按钮栏,则采用与按钮栏匹配的样式actionSheet.actionSheetStyle = UIActionSheetStyleDefault;// 利用tag标记多个ActionSheetactionSheet.tag = 100;
(3)点击响应
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ if (actionSheet.tag == 100) { if (buttonIndex == 0) { NSLog("你点击了是"); } if (buttonIndex == 1) { NSLog("你点击了否"); } }}
1 0
- 【iOS学习】十一、ActionSheet
- IOS学习 UIAlertView and ActionSheet
- IOS 开发学习32 actionSheet的使用
- IOS学习之ActionSheet,传说中的popWindow(三)
- [ios]自定义的ActionSheet
- iOS AlertView、ActionSheet
- iOS编程学习十一
- AndroidUi 高仿IOS ActionSheet
- IOS中操作表ActionSheet
- ActionSheet
- ActionSheet
- iOS alertController之actionsheet样式添加控件(类似自定义actionsheet)
- IOS 在actionSheet中加载progressView实例
- 仿IOS 菜单 ActionSheet Menu For Android
- 一劳永逸,iOS自定义ActionSheet封装流程
- 一劳永逸,iOS 自定义 ActionSheet 封装流程
- iOS开发之自定义ActionSheet视图
- 黑马程序员-iOS视频学习之十一
- (初级)单兵开发者开发环境最佳实践(Android+JavaWeb)
- Scanner ,Math.random()答题正确统计
- 预览 doc docx,xls,xlsx,pdf等API 说明文档
- 用Python玩数据-笔记二
- JS实现GridView式的数据加载(带滚动条)
- 【iOS学习】十一、ActionSheet
- Skipping failed optional dependency /chokidar/fsevents
- rgb图像色彩提取
- python 学习小结
- Java语言制作界面
- android图片压缩
- 做最好的自己
- java开发https请求ssl不受信任问题
- 大类和细类实现二级联动效果