【问题标题】:Setting transition to partial curl programmatically/code以编程方式/代码设置转换为部分卷曲
【发布时间】:2019-03-15 01:46:58
【问题描述】:

在 StoryBoard 中,我们可以如下进行可视化设置

我们如何使用.Xib/nib 文件做同样的事情?

[self presentViewController:self.infoController animated:YES completion:nil];

以上代码只是使用了模态样式,但是如何将过渡样式设置为部分卷曲。

【问题讨论】:

    标签: ios objective-c


    【解决方案1】:

    您可以使用以下代码执行此操作:

        #import "InfoController.h"
    
       - (IBAction)goToSecond:(id)sender { 
             InfoController *vc = [[InfoController alloc] initWithNibName:@"InfoController" bundle:nil];
             vc.modalTransitionStyle = UIModalTransitionStylePartialCurl;
             [self presentViewController:vc animated:YES completion:^{
               //completion code here
             }];
         }
    

    【讨论】:

    • 一个小建议.. Class names 始终使用 Camel 大小写。
    • @Dilip 谢谢.....你的解决方案是正确的。虽然我知道 UIModalTransitionStylePartialCurl 是一个枚举,但如何使用它在哪里使用它对我来说是一个问题......
    猜你喜欢
    • 2013-10-21
    • 1970-01-01
    • 2012-08-27
    • 2015-02-24
    • 2012-11-26
    • 2016-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多