首页 > 移动平台 > 详细

ios 8和iOS 9 适用的uidatepicker

时间:2015-10-13 18:52:28      阅读:478      评论:0      收藏:0      [点我收藏+]

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"\n\n\n\n\n\n\n\n\n\n\n"message:nil preferredStyle:UIAlertControllerStyleActionSheet];

    UIDatePicker *picker = [[UIDatePicker alloc] init];

    [picker setDatePickerMode:UIDatePickerModeDate];

    [alertController.view addSubview:picker];

    [alertController addAction:({

        UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

            NSLog(@"OK");

            NSLog(@"%@",picker.date);

        }];

        action;

    })];

    UIPopoverPresentationController *popoverController = alertController.popoverPresentationController;

    popoverController.sourceView = sender;

    popoverController.sourceRect = [sender bounds];

    [self presentViewController:alertController  animated:YES completion:nil];

ios 8和iOS 9 适用的uidatepicker

原文:http://www.cnblogs.com/isItOk/p/4875296.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!