Add UIView when keyboard is shown without being di

2019-09-12 03:54发布

问题:

This question is a bit difficult to explain. I have a textfield on top (where the navigation bar is usually is) and when I start editing text, the keyboard shows and auto dims the background. I want to add another UIView below the textfield but have that visible and not dimmed out.

Perfect image that describes what I want is this: http://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/Art/keyboard_size.jpg

I want to implement something similar like that google search bar underneath the search url bar. Notice how that is not dimmed out? How can I accomplish this?

Thanks!

回答1:

I think you can use navigation bar prompt for this. Look at the answer here Navigation bar with prompt - replace with image



回答2:

The Google search bar sits above the overlay view (the part that is dimmed). It is relatively easy to build the navigation bar, the textview, the view that you are wanting, and the webview beneath, respectively. If you want the dimmed look for the webview portion, then that too is relatively easy to implement, but I am not certain that is what you are looking for.