1
我有一个UISplitViewController安装程序,但由于某种原因,背景没有持续下去,直到你旋转了一次。iPad - UISplitViewController - 背景颜色
我使用IB来设置拆分视图并将详细视图设置为IPadDetailViewController
。里面,我有以下几点:
- (void)loadView {
[super loadView];
self.view.backgroundColor = [UIColor greenColor];
toolbar = [[UIToolbar alloc] initWithFrame:CGRectZero];
toolbar.barStyle = UIBarStyleDefault;
[toolbar sizeToFit];
[self.view addSubview:toolbar];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
self.view.backgroundColor = [UIColor orangeColor];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
self.interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
NSLog(@"it is in landscape!");
self.view.backgroundColor = [UIColor grayColor]];
}
else {
NSLog(@"it is in portrait!");
self.view.backgroundColor = [UIColor blueColor];
}
}
虽然代码被运行,我的工具栏在顶部得到的地方,视图保持黑色(它开始在景观的模拟器)。
任何想法,为什么?
好主意,但没有奏效。 :/ – RyanJM 2011-01-28 05:18:40