1

我想改变 Tabbar 的高度。

代码是:

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

rootController 是 TabBarController 对象。

在这里,我在调整标签栏大小后获得了视图和标签栏之间的空间。

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

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

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

4

2 回答 2

5

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

于 2009-12-09T13:06:41.093 回答
0

试试你的 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
于 2012-10-18T08:26:22.583 回答