【发布时间】:2024-01-06 06:27:01
【问题描述】:
所以我的应用程序中显示了一个模态视图,其中包含一些信息供用户填写。问题是当设备旋转时,会出现一些动画,但只在帧中。窗体本身不旋转。所有自动旋转选项都设置为 YES。当用户单击弹出窗口中的字段时,我会显示它。这让我怀疑它与此有关,但我不确定。这很奇怪,因为如果设备在任一视图中,然后显示模态窗口,那就没问题了。仅当设备在模态视图中旋转时才会发生。有谁知道旋转设备时可能导致这种行为的原因是什么?谢谢!
这是一个在弹出视图控制器中处理的 sn-p:
if (currentLevel == 1 && businessOrLocation == 0){
if(tbsViewController == nil)
tbsViewController = [[BusinessFilteredViewController alloc] initWithNibName:@"BusinessFilteredView" bundle:[NSBundle mainBundle]];
NSMutableArray *tempBusiness = [[NSMutableArray alloc] init];
for (id theKey in appDelegate.groupedBusiness) {
NSMutableArray *tempArr = [appDelegate.groupedBusiness objectForKey:theKey];
[tempBusiness addObject:tempArr];
}
tbsViewController.businessOrLocation = businessOrLocation;
tbsViewController.modalPresentationStyle = UIModalPresentationFullScreen;
tbsViewController.modalTransitionStyle = UIModalPresentationFullScreen;
[self presentModalViewController:tbsViewController animated:YES];
}
【问题讨论】:
-
您能否发布更多代码,尤其是您的 BusinessFilteredViewController 中的一些代码?就像你在这两个控制器的 willRotateToInterfaceOrientation:duration 函数中做了什么特别的事情?
-
我没有,这是默认选项。我需要做一些特别的事情吗?
标签: iphone objective-c ipad ios4