我无法将UITabbar放置在视图的顶部.解决方法 可能吗?当然,但是它违反了人机接口指南.
截图:
码:
TabController.h:
#import <UIKit/UIKit.h>@interface TabController : UITabbarController <UITabbarControllerDelegate>@end
TabController.m:
#import "TabController.h"@interface TabController ()@end@implementation TabController- (voID)vIEwDIDLoad{ [super vIEwDIDLoad]; self.delegate = self;}- (voID)vIEwWillLayoutSubvIEws{ [super vIEwWillLayoutSubvIEws]; [self.tabbar invalIDateIntrinsicContentSize]; CGfloat tabSize = 44.0; UIInterfaceOrIEntation orIEntation = [UIApplication sharedApplication].statusbarOrIEntation; if (UIInterfaceOrIEntationIsLandscape(orIEntation)) { tabSize = 32.0; } CGRect tabFrame = self.tabbar.frame; tabFrame.size.height = tabSize; tabFrame.origin.y = self.vIEw.frame.origin.y; self.tabbar.frame = tabFrame; // Set the translucent property to NO then back to YES to // force the UITabbar to reblur,otherwise part of the // new frame will be completely transparent if we rotate // from a landscape orIEntation to a portrait orIEntation. self.tabbar.translucent = NO; self.tabbar.translucent = YES;}- (voID)dIDReceiveMemoryWarning{ [super dIDReceiveMemoryWarning];}@end总结
以上是内存溢出为你收集整理的ios – 将UITabBar定位在顶部全部内容,希望文章能够帮你解决ios – 将UITabBar定位在顶部所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)