开发者

Detect if UIKeyBoard is Showing [duplicate]

开发者 https://www.devze.com 2023-01-19 06:06 出处:网络
This question already has answers here: How can I programmatically check whether a keyboard is present in iOS app?
This question already has answers here: How can I programmatically check whether a keyboard is present in iOS app? (21 answers) Closed 9 years ago.

I'd like to detect whether or not the keyboard is showing. I've found a few other posts that t开发者_开发百科raverse the subviews of UIWindow to find the keyboard, but if that is the only way then I'll figure out something else. I suppose I could also observe the UIKeyboard notifications, but I'm guessing there is a cleaner solution out there.


I am not sure what's "dirty" in observing UIKeyboard notifications but it definitely beats traversing UIWindow hierarchy.

0

精彩评论

暂无评论...
验证码 换一张
取 消