开发者

UISplitViewController Automatically hide Keyboard when taping on detail view

开发者 https://www.devze.com 2023-04-10 19:14 出处:网络
I have notic开发者_运维问答ed that a number of iPad apps using an UISearchBar and a UISplitViewController can gracefully hide the Keyboard when the user taps the detail view. This is really useful but

I have notic开发者_运维问答ed that a number of iPad apps using an UISearchBar and a UISplitViewController can gracefully hide the Keyboard when the user taps the detail view. This is really useful but I don't see how to implement this. For example this is done in the Mail application. Is there any automatic behavior doing this ? How can I efficiently implement it ?


This " How can I check if the hide button pf iPad's keyboard was pressed? " should help. I found (only tested in iOS5.1) that the keyboard was being dismissed anyway when the user tapped on the detail view, but the search bar wasn't getting any messages. The tip in the linked answer helps spot when the keyboard goes away so you can get rid of the search bar.

BTW: I think the current Mail app on iPad is bugged here: In landscape mode tap the search bar above the list of messages, then while it is active tap the detail view or the keyboard dismiss button - the search bar stays where it is and you need to use the Cancel button on it to get it to return to its resting position.

0

精彩评论

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