我尝试了下面的代码,试图让自定义视图显示在标签栏控制器上方(恰好在其所有选项卡中都有一个导航控制器)。在标签栏控制器/导航控制器上添加自定义视图?
问题是它重叠在导航栏的顶部,我想导航栏向下移动。
我试着设置标签栏控制器的框架,但是根本没有移动它。
- (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;
}
任何想法?
垂直高于其余内容。 – xil3
我把它放在顶部,但目前它覆盖了导航控制器。我需要按下标签栏控制器...... – xil3
使用一个modalViewController,其上的背景视图是当前视图控制器上的最顶层视图(类似于view.superview.superview.superview,直到它为零) – dwbrito