【问题标题】:iOS Horizontal transition of UIView controlleriOS UIView控制器的水平过渡
【发布时间】:2011-01-20 09:48:02
【问题描述】:

您好,我有一个问题,我想进行水平过渡,但在其他论坛上他们说这是不可能的

CrossViewController *screen = [[CrossViewController alloc] initWithNibName:nil bundle:nil];
        screen.modalTransitionStyle = UIModalTransitionStyleCoverVertical;//here i must add som horizontal transition animation
        [self presentModalViewController:screen animated:YES];
        [screen.but setTitle:@"funguje" forState:UIControlStateNormal];
        //screen.vyberUcet;
        [screen release];

我发现了,但它不起作用

here

谢谢

【问题讨论】:

    标签: objective-c cocoa-touch uikit uiviewcontroller


    【解决方案1】:

    根据UIViewController Class Reference,presentModalViewController 方法目前支持的唯一有效 UIModalTransitionStyle 转换是(iOS 4.2):

    • UIModalTransitionStyleCoverVertical
    • UIModalTransitionStyleFlipHorizo​​ntal
    • UIModalTransitionStyleCrossDissolve
    • UIModalTransitionStylePartialCurl

    (请参阅文档末尾“常量”部分中的“UIModalTransitionStyle”信息。)

    您确定要以模态方式呈现视图吗? (我不禁想知道您是否正在尝试创建 UINavigationController 样式设置。)

    【讨论】:

    • 您使用 UINavigationController 的建议让我重新评估了我的故事板并决定提前移动导航嵌入。好电话。
    【解决方案2】:

    如果您在 UINavigationController 中进行设置,将 navigationBarHidden 设置为 YES,然后执行通常的 UINavigationController 推送和弹出功能,这是否能满足您的需求?

    如果不是,那么我不知道您所说的“水平过渡”是什么意思。

    【讨论】:

    • 我没有使用导航控制器,但我开始在我的项目中实现它。事实是我刚刚熟悉 x 代码和目标 C。这对我来说需要一点时间,但谢谢很多人的帮助
    【解决方案3】:
    screen.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    

    不是我想要的,但现在已经足够了,谢谢你的帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-18
      • 2012-10-28
      • 2012-07-28
      • 1970-01-01
      相关资源
      最近更新 更多