【发布时间】:2011-04-16 17:58:36
【问题描述】:
我有一个情况,我创建了两个不同的笔尖,一个在纵向模式下,另一个在横向模式下。我在视图中有很多设计,所以我不得不选择两种不同的笔尖。现在,我想在界面在
中旋转时切换笔尖通用视图控制器
这样我就可以保留视图中控件的填充值和状态。
我现在正在使用
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Override to allow orientations other than the default portrait orientation.
if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight ){
[self initWithNibName:@"LandscapeNib" bundle:nil];
}else if(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
[self initWithNibName:@"PortraitNib" bundle:nil];
}
return YES;
}
但它不会改变笔尖,它会显示初始加载的笔尖。我猜它正在加载但没有显示,因为初始笔尖已经显示,没有被删除。我找不到使用通用视图控制器处理多个笔尖的解决方案,以便我可以轻松处理控件的功能?
【问题讨论】:
标签: iphone ipad orientation