how to show the tabbar when keyboard appears in iphone

别等时光非礼了梦想. 提交于 2019-12-31 06:58:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!