http://www.tuicool.com/articles/y6V3ye
解决方法:
UIActionSheet* startsheet = [[UIActionSheet alloc] initWithTitle:title
delegate:self
cancelButtonTitle:@"确定"
destructiveButtonTitle:nil
otherButtonTitles:nil,
nil];
startsheet.tag = 333;
[startsheet addSubview:datePicker];
[startsheet showInView:self.view];
IOS8以后:
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:nilpreferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"确定"style:UIAlertActionStyleCancel handler:^(UIAlertAction *action)
{
////todo
}];
[alertController.view addSubview:datePicker];
[alertController addAction:cancelAction];
[self presentViewController:alertController animated:YES completion:nil];
相关推荐
IOS自定义UIActionSheet的例子,供大家学习
以前在网上下了个时间选择器Demo,由于封装成UIActionSheet类型,而ios8弃用了UIActionSheet和UIAlertView,不得不对代码进行修改。将封装的UIActionSheet改为UIView,为了多态初始化时添加了枚举(几个时间选择器...
模仿IOS里面的UIActionSheet控件.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
iOS系统自带的UIActionSheet不方便修改内部button的字体大小,颜色,本人模仿实现了个小demo可以完成上述功能85
简单的自定义UIActionSheet
NULL 博文链接:https://eric-gao.iteye.com/blog/2086946
主要介绍了iOS中UIActionSheet动态添加按钮功能,非常不错,具有参考借鉴价值,需要的朋友可以参考下
UIActionSheet demo23456789
IOS应用源码——UIActionSheet 的美化效果.rar
IOS应用源码——UIActionSheet 的美化效果.zip
普通的列表对话框,使用简单,功能强大,可以自定义和强大,就像IOS中的UIActionSheet ##用 // Initialize an array of characters List< String> list = new ArrayList<> ( 3 ); list . add( " Send message ...
ios应用源码之仿uialertview和uiactionsheet的一个效果
主要介绍了iOS中 UIActionSheet字体的修改,需要的朋友可以参考下
NULL 博文链接:https://dingran.iteye.com/blog/1770376
UIActionSheet示例代码,IOS 开发总结
iOS程序中的Action Sheet就像Windows中的 “确定-取消”对话框一样,用于强制用户进行选择。当用户将要进行的操作具有一定危险时,常常使用Action Sheet对用户进行危险提示,这样,用户有机会进行取消操作。 Alert...
整合了UIAlertView和UIActionSheet这两种系统风格的弹框,创建弹框再也不用兼容iOS8以前和iOS8以后了。代码也不会因为delegate而分离,直接接受Block回调。如果您觉得我的代码帮到了您,我会非常欣慰。同时如果您想...
JXActionSheet(iOS8上下版本通用...一个简单的弹出视图,仿微信的退出登录弹出视图,类似iOS系统的UIActionSheet, 但是UIActionSheetiOS8后将废弃, JXAacionSheet将支持6.0以上各个版本,使用也很简单,支持屏幕旋转。