iPhone与android手机不同,软键盘上没有隐藏键。如果设计页面时,把TextField放在页面中部,把Button放在页面底部,当用户点击TextField输入内容完成后,由于软键盘挡住了Button,将使用户无法点击Button。这时只能在用户点击页面空白处时,用代码实现隐藏软键盘了: