UIDatePicker *datePicker = [[UIDatePicker alloc] init]; datePicker.datePickerMode = UIDatePickerModeDate;

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

[alert.view addSubview:datePicker];

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

NSDateFormatter* dateFormat = [[NSDateFormatter alloc] init];

//实例化一个NSDateFormatter对象

[dateFormat setDateFormat:@"yyyy-MM-dd"];//设定时间格式

NSString *dateString = [dateFormat stringFromDate:datePicker.date];

//求出当天的时间字符串

NSLog(@"%@",dateString);

}];

UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

  }];

[alert addAction:ok];

[alert addAction:cancel];

[self presentViewController:alert animated:YES completion:^{ }];

iOS8 UIAlertController弹出框中添加视图(例如日期选择器等等)的更多相关文章

  1. 苹果手机iOS11中fixed弹出框中input光标错位问题

    最近遇到了一个移动前端的BUG:手机弹出框中的输入框focus时光标可能会错位. 刚开始时我完全不知道错误原因是什么,在电脑上调试时完全没有问题,手机上出现问题时也没有找到规律.后来在网上搜索了大量的 ...

  2. 在IOS11中position:fixed弹出框中的input出现光标错位的问题

    问题出现的背景: 在IOS11中position:fixed弹出框中的input出现光标错位的问题 解决方案 一.设计交互方面最好不要让弹窗中出现input输入框: 二.前端处理此兼容性的方案思路: ...

  3. 弹出框中选项卡的运用(easyUI)

    先看一下页面效果: 此处有两个知识点:一个是弹出框的运用,一个是选项卡的运用 分析一下该HTML代码,最外面一个div是弹出框的,默认是关闭状态,可通过ID来控制弹出框的开关,该div的样式是easy ...

  4. 弹出框中的AJAX分页

    $(function() { $("body").on("click",".set-topic",function(){ /*获取所有题目接 ...

  5. 【iOS】UIAlertController 弹出框

    UIAlertView 虽然还能用,但已经废弃了.因此以后尽量用 UIAlertController.示例代码如下: UIAlertController *alert = [UIAlertContro ...

  6. 使用easeui dialog弹出框中使用CKeditor多次加载后无法编辑问题

    问题呈现:弹出框页面 <tr class="addtr"> <th>内容</th> <td> <!-- <textare ...

  7. mvc 在弹出框中实现文件下载

    var myParent = parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent; ...

  8. vue在element-ui的dialog弹出框中加入百度地图

    参考:https://blog.csdn.net/u012724595/article/details/82703579 <!-- gps弹窗 --> <el-dialog v-di ...

  9. firefox浏览器中 bootstrap 静态弹出框中select下拉框不能弹出(解决方案)

    问题出现场景1: 在firefox浏览器中在bootstrap弹出的modal静态框中再次弹出一个静态框时 select下拉框不能弹出选项 解决方案:去掉最外层静态框的 tabindex=" ...

随机推荐

  1. hdu Super Jumping

    简单的dp,最优子结构是dp[i],即从0~i来看,是的dp[i]最大,然后找到最大中的最大就可以了, 转移方程是:dp[i]=max{dp[i],dp[j]+value[i]},注意这里有两个判断条 ...

  2. 记sql语句空格带来的问题

    在做分页的时候,引用了一个分页类.在一条sql语句出发生错误,没查出数据,代码如下 $sql="select * from sw_goods".$page->limit; 正 ...

  3. cmd命令行查看windows版本

    1.ver命令不显示sp几 C:\>ver Microsoft Windows XP [Version 5.1.2600] C:\> 08: C:\Users\Administrator& ...

  4. [转]C#开发ActiveX控件,.NET开发OCX控件案例

    引自:百度   http://hi.baidu.com/yanzuoguang/blog/item/fe11974edf52873aaec3ab42.html 讲下什么是ActiveX控件,到底有什么 ...

  5. HTML练习----注册界面

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. 9. Add the Block Storage service

    Block Storage Server: 1. sudo apt-get install python-mysqldb   2. sudo apt-get install lvm2   3. 创建存 ...

  7. 【液晶模块系列基础视频】1.1.iHMI43模块介绍

    [液晶模块系列基础视频]1.1.iHMI43模块介绍(上) [液晶模块系列基础视频]1.1.iHMI43模块介绍(下) ============================== 技术论坛:http ...

  8. 【iCore2 模块相关资料】发布模块DEMO 代码包,目前支持 iM_TFT30、 iM_LAN和 iM_RGB 三个模块

    iCore2 模块底板 和部分模块发布了,所以我们做了一个 DEMO 代码包,此代码包现在有以下功能: 1.支持 iM_TFT30 3寸触摸液晶模块(硬件已发布): 2.支持 iM_LAN 100M以 ...

  9. PHP $_SERVER 详解

    元素/代码 描述 $_SERVER['PHP_SELF'] 当前执行脚本的文件名,与 document root 有关. $_SERVER['GATEWAY_INTERFACE'] 服务器使用的 CG ...

  10. PHP报错: Can't use method return value in write context

    $dp_id = $this->getParam('dpId'); if(!empty($this->getParam('dpId'))) { $this->smarty->a ...