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

picker.datePickerMode = UIDatePickerModeDate;

picker.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"];

// 设置键盘

self.myfield.inputView = picker;

// 设置键盘上面的工具条

self.myfield.inputAccessoryView = [UIButton buttonWithType:UIButtonTypeContactAdd];

// 设置键盘上的ToolBar

UIBarButtonItem *prevButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"上一项" style:UIBarButtonItemStyleBordered target:selfaction:@selector(ShowPrevious)];

UIBarButtonItem *nextButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"下一项" style:UIBarButtonItemStyleBordered target:selfaction:@selector(ShowNext)];

UIBarButtonItem *hiddenButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"隐藏键盘" style:UIBarButtonItemStyleBordered target:selfaction:@selector(HiddenKeyBoard)];

UIBarButtonItem *spaceButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem: UIBarButtonSystemItemFlexibleSpace target:nil action:nil];

UIToolbar *accessoryView = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44)];

accessoryView.barStyle = UIBarStyleBlackTranslucent;

accessoryView.items = [NSArray arrayWithObjects:prevButtonItem,nextButtonItem,spaceButtonItem,hiddenButtonItem,nil];

self.myfield.inputAccessoryView = accessoryView;

 
 

最新文章

  1. Introduction of python
  2. mac composer 安装
  3. hdu4273Rescue(三维凸包重心)
  4. Codeforces Round #297 (Div. 2)
  5. Golang 开发移动应用的OpenGL(Android为例)的渲染管线
  6. svn 提交失败 更新失败 提示 已经锁定
  7. C#基础精华07(委托事件,委托的使用,匿名方法)
  8. div border-radius
  9. 使用solr报错,错误信息 include(SolrClient.php): failed to open stream: No such file or directory
  10. win7使用右键导致死机、假死、explorer无法响应的解决方法
  11. select空间提交form表单传递参数
  12. 初学Python(八)——迭代
  13. Nuget私有服务搭建实战
  14. spring定时任务详解(@Scheduled注解)
  15. flask 跨域问题
  16. 【GIS】无人机影像数据关系换算(转)
  17. selenium键盘操作
  18. 杭电 OJ 提交代码需要注意的问题
  19. Sutherland-Hodgeman多边形裁剪
  20. js中字符串的常用方法

热门文章

  1. c#索引器的简单用法
  2. 处理器在 protected mode 下的 protection
  3. 开发问题记录——AE开发提示80040111错误
  4. js获取url参数值的两种方式
  5. python开源项目及示例代码
  6. [转]DRY原则和Shy原则
  7. install ruby and ruby gem
  8. raise_application_error用法
  9. OFBiz进阶之HelloWorld(三)CRUD操作
  10. 【Passport】微软过时的技术