更改标签栏高度时出现问题

发布于 2024-08-14 12:08:44 字数 516 浏览 6 评论 0原文

我想改变标签栏的高度。

代码是:

    rootController.tabBar.frame= CGRectMake(0,450,320,30);

rootController是TabBarController对象。

在这里,我得到了我的视图和视图之间的空间。调整选项卡栏大小后的选项卡栏。

那么调整它的大小是没有用的。如何正确调整它的大小,以便 myview 和 myview 之间的空间tabbar可以去掉吗?

|--------------------|
|
|
|
|
|
|........................|这里在视图和视图之间我的标签栏空间仍然存在
|........................|
|视图1 |视图2 |
|--------------------|

有什么解决办法吗? 提前致谢 ...

I want to change the height of Tabbar.

the code is :

    rootController.tabBar.frame= CGRectMake(0,450,320,30);

rootController is TabBarController Object.

here I am getting the space between my view & tabbar after resizing the tabbar.

then Its of no use to resize it. How to resize it properly so that space between myview & tabbar can be eliminated ?

|--------------------|
|
|
|
|
|
|........................|here between view & my tabbar space remains
|........................|
| view1 | view2 |
|--------------------|

Is there any solution?
Thanks in advance ...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深海少女心 2024-08-21 12:08:44

我很确定标签栏不是设计来调整大小的。苹果希望这些东西的尺寸和外观保持一致。

I'm pretty sure the tabbar isn't designed to be resized. Apple want a consistent size and look with these kinds of things.

从来不烧饼 2024-08-21 12:08:44

尝试 rootController 中的代码:

//CUSTOM TABBAR!!
//change tabbar's height
float windowheight = [UIScreen mainScreen].bounds.size.height;
self.tabBar.frame = CGRectMake(0, windowheight - 30, 320, 30);

//here you can see the UITransitionView's bounds before changed.
NSLog(@"subView=%@", [self.view subviews]);

//change UITransitionView 's height 
((UIView *)[[self.view subviews] objectAtIndex:0]).frame = CGRectMake(0, 0, 320, windowheight - 30);

//then add your CustomTabBarView

Try the code in your rootController:

//CUSTOM TABBAR!!
//change tabbar's height
float windowheight = [UIScreen mainScreen].bounds.size.height;
self.tabBar.frame = CGRectMake(0, windowheight - 30, 320, 30);

//here you can see the UITransitionView's bounds before changed.
NSLog(@"subView=%@", [self.view subviews]);

//change UITransitionView 's height 
((UIView *)[[self.view subviews] objectAtIndex:0]).frame = CGRectMake(0, 0, 320, windowheight - 30);

//then add your CustomTabBarView
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文