即使我更改了主窗口也不会更改?
嘿! 有一个问题让我抓狂!当在 xcode 4 中的界面生成器中进行更改时,我的主窗口不会更改,我已经玩了 2 个多小时试图进行更改,但在构建时它不会更改。当代码中的某些内容发生变化时,它就可以正常工作。 我试图添加到主窗口的是选项卡栏中的一个新选项卡。 请帮我 !
更新:
我的应用程序didfinfishwithoptions 看起来像这样。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[window addSubview:navigationController.view];
[window addSubview:tabBarController.view];
[self.window makeKeyAndVisible];
return YES;
}
Hey!
Have a problem that is driving me crazy! My Main Window will not change when a make changes in interface builder in xcode 4, I have played around for over 2 hours trying to make changes but when a build it does not change. When a change something in the code it works just fine.
The thing I'm trying to add to the main window is a new tab in the tabbar.
Please help me !
UPDATE:
My applictiondidfinfishwithoptions looks like this.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[window addSubview:navigationController.view];
[window addSubview:tabBarController.view];
[self.window makeKeyAndVisible];
return YES;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保将选项卡添加到分配给主窗口的根视图控制器属性的任何视图。如果将项目拖到窗口本身中,它将不起作用。让事情变得复杂的是,一些 Apple 模板在应用程序委托的 application:didFinishLaunchingWithOptions: 方法中配置根视图控制器,因此请检查那里以查看分配的内容。
更新:
您应该向窗口添加一个视图,并将其他视图添加为子视图。
Make sure that you are adding the tab to whatever view is assigned to the main window's root view controller property. If you drag and item into the window itself it won't work. To complicate matters, some of Apple's templates configure the root view controller in the application delegate's
application:didFinishLaunchingWithOptions:
method, so check there to see what is being assigned.UPDATE:
You should add one view to the window and add the other views as subviews.