当键盘出现在iphone中时如何显示标签栏 [英] how to show the tabbar when keyboard appears in iphone

查看:28
本文介绍了当键盘出现在iphone中时如何显示标签栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我在基于 tabbar 的应用程序中工作,我需要在其中显示键盘,键盘通常会出现,但我希望我的 tabbar 应该显示出来,并且在 tabbar 的上方,只有键盘应该显示如何做到这一点..谢谢大家

解决方案

你可以像这样随着键盘移动标签栏:

- (IBAction)textBoxEditing:(id)sender {CGRect frame = [[[self tabBarController] tabBar] frame];frame.origin.y = 712;[UIView animateWithDuration:0.25f 动画:^{[[[self tabBarController] tabBar] setFrame:frame];}];}

以上示例适用于纵向 iPad.712 是 tabbar(975) 的原始位置减去键盘的高度 (264).

阅读更多

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

解决方案

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

这篇关于当键盘出现在iphone中时如何显示标签栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆