IOS How to make the view cover keyboard
Posted
by
regrecall
on Stack Overflow
See other posts from Stack Overflow
or by regrecall
Published on 2012-08-30T15:37:05Z
Indexed on
2012/08/30
15:38 UTC
Read the original article
Hit count: 206
I encounter the a problem:
I have a view controller like this.
TO make tool bar up when the keyboard appear, I move the self.view to up.
[self.view setFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y + keyboardFrame.size.height * (up ? -1 : 1), self.view.frame.size.width, self.view.frame.size.height)];
Now I want to click the left button in the tool bar, and appear the view that frame is same as the this keyboard.
But where can I add this view? if add the subview to the self.view, it will move up with the self.view on the top of the keyboard, not cover. I'm a beginner about IOS, I have no idea about it, and have searched, but got nothing about this.
another question, IF when the toolbar at the bottom, I aslo want to click the left button on it to show the view(the animation and frame both are the same as the keyboard), how can I do ?
Can you help me? Thanks
© Stack Overflow or respective owner