how to show the tabbar when keyboard appears in ip

2019-03-05 11:44发布

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

2条回答
一夜七次
2楼-- · 2019-03-05 12:21

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.

查看更多
闹够了就滚
3楼-- · 2019-03-05 12:32

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

查看更多
登录 后发表回答