检测用户是否按下Go或隐藏键盘按钮UITextField [英] detecting if User pressed Go or hide keyboard button UITextField

查看:102
本文介绍了检测用户是否按下Go或隐藏键盘按钮UITextField的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个浏览器类型应用..

I am making a browser type app..

现在我已经让网址输入 textfield ...显示键盘..

Now i have made the Url entering textfield...which shows up the keyboard..

现在我把它变成了Url型键盘.. 它有Go按钮,而iPad则是一个隐藏键盘的按钮..

Now i have made it be Url type keyboard..it has Go button and for iPad a button to hide the keyboard..

-(BOOL)textFieldShouldReturn:(UITextField *)textField

我知道上面是当用户点击键盘返回时调用的方法..
但是对于iPad ..有两个不同的东西..我想要如果用户按下Go,则转到新的URL。如果用户按下隐藏键盘,则保持窗口不变..但问题是事件报告

i know above is the method that is called when user clicks return on Keyboard.. but for iPad ..there are two different things..i want to go the new URL if user presses Go..and leave the window as it is if user presses hide keyboard..but the problem is both the events report

-(BOOL)textFieldShouldReturn:(UITextField *)textField

so我如何区分用户按下Go ..或只是隐藏键盘..

推荐答案

显然现在似乎是Go按钮仅报告

Apparently now it seems that the Go button only reports

-(BOOL)textFieldShouldReturn:(UITextField *)textField

并隐藏键盘按钮没有..

and hide keyboard button doesn't..

我很确定昨天不是这样的..但反正..我相信我只能责怪如果有人需要清算,我会把问题打开。

I am pretty sure yesterday this was not the case..but anyways..i believe i am only to blame for this mess up..i will leave the question open if anyone needs clearing.

这篇关于检测用户是否按下Go或隐藏键盘按钮UITextField的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆