我尝试了以下代码,试图让自定义视图显示在选项卡控制器上方(该选项卡控制器内部包含导航控制器的所有选项卡)。
问题是它覆盖在导航栏的上方,而我想将导航栏向下移动。
我尝试设置选项卡控制器的框架,但没有移动它。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Add the tab bar controller's current view as a subview of the window
//self.tabBarController.view.frame = CGRectMake(0, 62, 320, 320);
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
// setting up the header view
self.headerView = [[HeaderView alloc] initWithFrame:CGRectMake(0, 20, 320, 42)];
[self.window addSubview:self.headerView];
// setting up facebook stuff
AgentSingleton *agentSingleton = [AgentSingleton sharedSingleton];
agentSingleton.facebook = [[Facebook alloc] initWithAppId:APP_ID];
return YES;
}
任何想法?