码迷,mamicode.com
首页 > 移动开发 > 详细

iOS8中的UIActionSheet添加UIDatePicker后,UIDatePicker不显示问题

时间:2015-10-13 20:43:37      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

解决方法:

 
IOS8以前:

                    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];

iOS8中的UIActionSheet添加UIDatePicker后,UIDatePicker不显示问题

标签:

原文地址:http://www.cnblogs.com/isItOk/p/4875549.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!