问题
hello all i am working in a tabbar based application where i need to show a keyboard , the keyboard appearing generally but I want my tabbar should be shown and on above of the tabbar only the keyboard should shown how this can be done.. thank you all
回答1:
You can move the tabbar along with the keyboard like this:
- (IBAction)textBoxEditing:(id)sender {
CGRect frame = [[[self tabBarController] tabBar] frame];
frame.origin.y = 712;
[UIView animateWithDuration:0.25f animations:^
{
[[[self tabBarController] tabBar] setFrame:frame];
}];
}
The example above is for iPad in portrait. 712 is the original position of the tabbar(975) minus the height of the keyboard(264).
Read More
回答2:
This is impossible. The keyboard always appears at the bottom of the screen.
If the tabbar is needed while the keyboard is visible you could only move the tabbar above the keyboard, or resize the tabbarcontroller, so that the tabbar remains visible.
Are you shure you need the tabbar while the keyboard is visible? Remember a tabbar is for changing the view. Perhaps you need to rethink your interaction design.
来源:https://stackoverflow.com/questions/3509701/how-to-show-the-tabbar-when-keyboard-appears-in-iphone