编辑:
我已经把这个问题缩小了一点.当使用UIModalPresentationFullScreen呈现模态视图时,模态视图“幸存”旋转.
我该怎么做才能解决这个问题?
这是我对willRotatetoInterfaceOrIEntation的实现:
- (voID) willRotatetoInterfaceOrIEntation:(UIInterfaceOrIEntation)toInterfaceOrIEntation duration:(NSTimeInterval)duration{[super willRotatetoInterfaceOrIEntation:toInterfaceOrIEntation duration:duration];//// Load an alternate vIEw depending on the orIEntation//if (toInterfaceOrIEntation == UIInterfaceOrIEntationLandscapeleft) { [UIVIEw beginAnimations:@"" context:nil]; [self setVIEw:theLandscapeVIEw]; self.vIEw.bounds = CGRectMake(0,1024,768); self.vIEw.transform = CGAffinetransformMakeRotation(kdegreesToradians * (-90)); [UIVIEw commitAnimations]; }else if (toInterfaceOrIEntation == UIInterfaceOrIEntationLandscapeRight) { [UIVIEw beginAnimations:@"" context:nil]; [self setVIEw:theLandscapeVIEw]; self.vIEw.bounds = CGRectMake(0,768); self.vIEw.transform = CGAffinetransformMakeRotation(kdegreesToradians * (90)); [UIVIEw commitAnimations];}else if (toInterfaceOrIEntation == UIInterfaceOrIEntationPortrait) { [UIVIEw beginAnimations:@"" context:nil]; [self setVIEw:thePortraitVIEw]; self.vIEw.transform = CGAffinetransformMakeRotation(kdegreesToradians * (0)); self.vIEw.bounds = CGRectMake(0,768,1024); [UIVIEw commitAnimations];}else if (toInterfaceOrIEntation == UIInterfaceOrIEntationPortraitUpsIDeDown) { [UIVIEw beginAnimations:@"" context:nil]; [self setVIEw:thePortraitVIEw]; self.vIEw.transform = CGAffinetransformMakeRotation(kdegreesToradians * (180)); self.vIEw.bounds = CGRectMake(0,1024); [UIVIEw commitAnimations];} }@R_301_6120@ 如果我解决了这个问题,我会做以下其中一项
>将备用视图添加到父视图,而不是更改视图属性
>为不需要完整视图交换的视图创建设计,但重新排列或隐藏视图的子元素.
>显示层次结构的根VIEwController中的任何模态
为了方向,我会非常努力不完全换掉视图.即使你已经解决了这个问题,它似乎还会继续存在问题.
总结以上是内存溢出为你收集整理的objective-c – 如何在iPad上旋转时停止模态视图的消失?全部内容,希望文章能够帮你解决objective-c – 如何在iPad上旋转时停止模态视图的消失?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)