gpt4 book ai didi

iphone - 在标签栏 Controller /导航 Controller 上方添加自定义 View ?

转载 作者:行者123 更新时间:2023-12-03 18:25:18 25 4
gpt4 key购买 nike

我尝试了以下代码,试图让自定义 View 显示在选项卡栏 Controller 上方(它的所有选项卡中恰好都有一个导航 Controller )。

问题是它覆盖在导航栏的顶部,我希望导航栏向下移动。

我尝试设置标签栏 Controller 的框架,但这根本没有移动它。

- (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;
}

有什么想法吗?

最佳答案

将 View 添加到 tabBarController View 本身:

[self.tabBarController.view addSubview:yourView];

关于iphone - 在标签栏 Controller /导航 Controller 上方添加自定义 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6821472/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com