zoukankan      html  css  js  c++  java
  • ios 8和iOS 9 适用的uidatepicker

    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@" "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];

  • 相关阅读:
    解析网页源码方式
    vue踩坑--细节决定成败
    fallowing-travelvue
    学会不怕
    eslint代码规范检测
    三次握手+四次挥手
    小白的学习笔记
    es6数组
    css知识整理
    JavaScript之事件循环,宏任务与微任务
  • 原文地址:https://www.cnblogs.com/isItOk/p/4875296.html
Copyright © 2011-2022 走看看