小编Gen*_*sST的帖子

iOS 6:旋转后忽略父模态的modalPresentationStyle

使用iOS6的iPad,我们有这个错误,即模态视图控制器将扩展到全屏,即使它被告知使用"表单"演示样式.但是,只有当有两个模态,一个父模型及其子模式时,才会发生这种情况.

这就是第一个模态的创建和呈现方式:

UINavigationController *navigationController = [[[UINavigationController alloc] initWithRootViewController:controller] autorelease];
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
[parentController presentModalViewController:navigationController animated:YES];
// parentController is my application's root controller
Run Code Online (Sandbox Code Playgroud)

这是创建和呈现子模态的方式:

UINavigationController *navigationController = [[[UINavigationController alloc] initWithRootViewController:controller] autorelease];
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
[parentController presentModalViewController:navigationController animated:YES];
// parentController is the navigationController from above
Run Code Online (Sandbox Code Playgroud)

因此,当从横向旋转到纵向时,即使我们旋转回横向,父模式也会扩展到全屏并保持这种状态.

当我们拥有父模态本身(没有子模态)时,它按预期工作,即它保持在表单样式中.

请注意,这只发生在iOS6(设备和模拟器)上,并且不会发生在iOS 5(模拟器上,并报告由测试人员工作).

到目前为止,我已经尝试了以下但没有成功:

  • 设置wantsFullScreenLayout为NO
  • 强迫wantsFullScreenLayout总是NO通过覆盖它来返回
  • 在导航控制器中确定我的控制器也指定 UIModalPresentationFormSheet
  • 实施 preferredInterfaceOrientationForPresentation
  • 升级到iOS 6.0.1

谢谢!


更新:所以,我调整了Apple开发者论坛(https://devforums.apple.com/message/748486#748486)的响应,以便它可以与多个嵌套模式一起使用.

- (BOOL) needNestedModalHack {
    return [UIDevice currentDevice].systemVersion.floatValue >= 6;
}

- (void) …
Run Code Online (Sandbox Code Playgroud)

modal-dialog rotation ipad ios

33
推荐指数
2
解决办法
5627
查看次数

升级到Android Developer Tools版本22后,编译失败

今天,我将ADT升级到22版.之后,我的projet根本无法编译资源.我的"gen"文件夹是空的,因此我需要"R"的所有java文件都无法编译.

android adt

28
推荐指数
2
解决办法
5463
查看次数

iOS:iOS 7.1上的子类UITabBarController上有更多选项卡崩溃

我只是更新到iOS 7.1,我得到一个名为"_layoutCells"的函数无法识别的选择错误.

我有一个简单的UITabBarController子类.

uitabbarcontroller ios7

5
推荐指数
1
解决办法
749
查看次数

标签 统计

adt ×1

android ×1

ios ×1

ios7 ×1

ipad ×1

modal-dialog ×1

rotation ×1

uitabbarcontroller ×1