IOS-49-UIActionSheet在iOS8后已废弃,以下为各版本通用适配办法
2016-01-26 14:57
441 查看
搞了半天,原来UIActionSheet在iOS8后已废弃,怪不得在iPhone5上好好地,iPhone6就废了,一个简单的弹出视图,仿微信的退出登录弹出视图,类似iOS系统的UIActionSheet, 但是UIActionSheetiOS8后废弃, JXAacionSheet将支持6.0以上各个版本,使用也很简单,支持屏幕旋转。
实现效果:
之前的代码是这样的:
解决办法:在github上找到一个封装的第三方库,代码实现如下:
demo下载地址:http://download.csdn.net/detail/iot_li/9418380
实现效果:
之前的代码是这样的:
UIActionSheet *sheetView = [[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"立即充电",@"定时充电",@"智能充电(敬请期待)", nil]; [sheetView showInView:[UIApplication sharedApplication].keyWindow];
解决办法:在github上找到一个封装的第三方库,代码实现如下:
JXActionSheet *sheetView = [[JXActionSheet alloc]initWithTitle:nil cancelTitle:@"取消" otherTitles:@[@"立即充电",@"定时充电",@"智能充电(敬请期待)"]]; sheetView.destructiveButtonIndex = 2; [sheetView showView]; [sheetView dismissForCompletionHandle:^(NSInteger clickedIndex, BOOL isCancel){ if (clickedIndex == 0) { ············· } }
demo下载地址:http://download.csdn.net/detail/iot_li/9418380
相关文章推荐
- LeetCode304. Range Sum Query 2D - Immutable
- UI方面总结
- php imagecreatetruecolor()方法报未定义错误解决方法
- iOS自定义UIButton的实现
- add "shadow+border+corner" specially for UIView
- UITextField输入框的字靠右一点显示
- poj-2299-Ultra-QuickSort(线段树 || 归并排序)
- UISegmentedControl 踩坑
- view 转为image 清晰度不变
- Label的文字自适应
- HDU 1242 Rescue (BFS or DFS)
- iPhone开发 – 小技巧二则 (UIColor 16进制颜色 | UIview设置frame)
- 解决iOS UITextField输入的内容在代理方面里面不能全部获取到
- value文件中的小点,String内容调取
- Graphical Layout出现EditText (Change to android.widget.EditText, Fix Build Path, Edit XML)
- java整合easyui进行的增删改操作
- mysql insert中文乱码无法插入ERROR 1366 (HY000): Incorrect string value
- UICollectionView-集合视图
- codefoces 597C - Subsequences
- android graphic(6)—surfaceflinger和MessageQueue