views:

1563

answers:

2

Hi,

I would like to have the keyboard already displaying when I show my view.

I have two view controllers, of which the keyboard is part of the second. However, when I call [textField becomeFirstResponder] during the second view controller's viewDidLoad method, the keyboard slides up on top of the first view.

Is there any way I can have the keyboard already slid up into place but still covered by the first view until I want to uncover it?

Thanks

+1  A: 

I just started iphone dev this week but saw this post. Don't know if this helps at all or not.

http://www.iphonedevsdk.com/forum/iphone-sdk-development/2716-uisearchbar-show-keyboard-load.html

TEEKAY
Thanks for the link. However, I can get the keyboard to show fine. The problem is that it slides up infront of a view that it should be hidden behind. I just can't figure out how to get the keyboard to slide up behind my top level view so that I can uncover it later on without having to display the sliding up animation
Harry
Hey Harry, did you ever figure this out? I'm having the same issue…
Theory
A: 

The keyboard is added as a subview to the UIWindow instance on purpose so you can't do what you are asking.

You may be able to get around it. There are ways to find the keyboard:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/6573-howto-customize-uikeyboard.html

Once you have the keyboard, you might be able to reorder it to the back by rearranging the subviews of the UIWindow instance, but this is not guaranteed and definitely not supported. if you get this to work, it may break in the future.

Corey Floyd
That's a shame. I was kind of hoping it was just added as a subview of the textfield's parent view. I'll check out the reordering of UIWindow's subviews, but it's a tad hacky for my liking.Thanks for the useful answer
Harry