怎样设置ios中tabbar的高度
若以下回答无法解决问题,邀请你更新回答
1个回答
2016-07-17 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
关注
展开全部
TabBarController 的 View 的子视图信息来查看视图层级的布局:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self printViewHierarchy:self.tabBarController.view];
}
- (void)printViewHierarchy:(UIView *)superView
{
static uint level = 0;
for(uint i = 0; i < level; i++){
printf("\t");
}
const char *className = NSStringFromClass([superView class]).UTF8String;
const char *frame = NSStringFromCGRect(superView.frame).UTF8String;
printf("%s:%s\n", className, frame);
++level;
for(UIView *view in superView.subviews){
[self printViewHierarchy:view];
}
--level;
}
结果如下:
UILayoutContainerView:{{0, 0}, {320, 480}}
UITransitionView:{{0, 0}, {320, 480}}
UIViewControllerWrapperView:{{0, 0}, {320, 480}}
UIView:{{0, 0}, {320, 480}}
UITabBar:{{0, 431}, {320, 49}}
_UITabBarBackgroundView:{{0, 0}, {320, 49}}
_UIBackdropView:{{0, 0}, {320, 49}}
_UIBackdropEffectView:{{0, 0}, {320, 49}}
UIView:{{0, 0}, {320, 49}}
UITabBarButton:{{2, 1}, {156, 48}}
UITabBarSwappableImageView:{{54, 2}, {48, 32}}
UITabBarButtonLabel:{{68, 35}, {21, 12}}
UITabBarButton:{{162, 1}, {156, 48}}
UITabBarSwappableImageView:{{54, 2}, {48, 32}}
UITabBarButtonLabel:{{60, 35}, {36, 12}}
UIImageView:{{0, -0.5}, {320, 0.5}}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self printViewHierarchy:self.tabBarController.view];
}
- (void)printViewHierarchy:(UIView *)superView
{
static uint level = 0;
for(uint i = 0; i < level; i++){
printf("\t");
}
const char *className = NSStringFromClass([superView class]).UTF8String;
const char *frame = NSStringFromCGRect(superView.frame).UTF8String;
printf("%s:%s\n", className, frame);
++level;
for(UIView *view in superView.subviews){
[self printViewHierarchy:view];
}
--level;
}
结果如下:
UILayoutContainerView:{{0, 0}, {320, 480}}
UITransitionView:{{0, 0}, {320, 480}}
UIViewControllerWrapperView:{{0, 0}, {320, 480}}
UIView:{{0, 0}, {320, 480}}
UITabBar:{{0, 431}, {320, 49}}
_UITabBarBackgroundView:{{0, 0}, {320, 49}}
_UIBackdropView:{{0, 0}, {320, 49}}
_UIBackdropEffectView:{{0, 0}, {320, 49}}
UIView:{{0, 0}, {320, 49}}
UITabBarButton:{{2, 1}, {156, 48}}
UITabBarSwappableImageView:{{54, 2}, {48, 32}}
UITabBarButtonLabel:{{68, 35}, {21, 12}}
UITabBarButton:{{162, 1}, {156, 48}}
UITabBarSwappableImageView:{{54, 2}, {48, 32}}
UITabBarButtonLabel:{{60, 35}, {36, 12}}
UIImageView:{{0, -0.5}, {320, 0.5}}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询