一种比较简单的点击屏幕空白处退出键盘的方法:

在ViewController中加入如下代码:

   1:  -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
   2:      
   3:  [self.view endEditing:YES];
   4:      
   5:  }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

 

即可

最新文章

  1. java自定义类加载器
  2. iOS后台定位时授权提示一闪而过的解决办法
  3. VBS编辑字段
  4. 【读书笔记】iOS-内存管理
  5. [译]SQL Server 之 查询优化器
  6. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Demacia of the Ancients
  7. 回调函数的实现 & 结构体的继承
  8. Multithreading annd Grand Central Dispatch on ios for Beginners Tutorial-多线程和GCD的入门教程
  9. VC printf输出彩色字体
  10. Wpf TextChanged事件导致死循环,事件触发循环问题
  11. Swift—属性观察者-备
  12. POJ 3104 Drying(二分答案)
  13. Android Studio的使用(二)--Debug调试
  14. [NOIp 2016]愤怒的小鸟
  15. SpringMVC接收json数组对象
  16. Python框架学习之Flask中的常用扩展包
  17. HTML CSS JavaScript 工作笔记
  18. C#检查服务状态和启动关闭服务
  19. Spring注解 @Configuration
  20. 如何学php少走弯路

热门文章

  1. 本地上jar命令
  2. [CVPR2017]Online Video Object Segmentation via Convolutional Trident Network
  3. O(n^2)以及O(nlogn)时间复杂度的排序算法
  4. jquery遍历之后代
  5. Javadoc注释的用法
  6. 最适合初学者学习的idea教程
  7. bzoj 1012 基础线段树
  8. ubuntu安装mysqlclient
  9. Linux core dump file详解
  10. Linux实现利用SSH远程登录服务器详解