【问题标题】:problem with showing modalviewcontroller in landscape mode in iphone?在 iphone 中以横向模式显示 modalviewcontroller 的问题?
【发布时间】:2010-04-05 09:31:35
【问题描述】:

我的应用程序包含一个横向视图,我想在其中放置一个模态视图,但问题在于模态视图。展示它不会有负担..代码是:

--------------------代码在这里----------

UIViewController *modalViewController = [[UIViewController alloc] init];

modalViewController.view = modelView1; [self presentModalViewController:modalViewController Animation:NO];

[self performSelector:@selector(hideSplash) withObject:nil afterDelay:5.0];


请帮我解决这个问题....

【问题讨论】:

    标签: iphone


    【解决方案1】:

    你的代码的问题是你用alloc-init初始化它,没有任何笔尖名称。现在调用时:

    [self presentModalViewController:modalViewController animated:NO];
    

    视图将通过调用它的 loadview 方法来加载自己,而你肯定没有任何东西。因此,如果您确实想以相同的方式进行初始化,只需尝试移动代码行:

    modalViewController.view = modelView1;
    

    之后:

    [self presentModalViewController:modalViewController animated:NO];
    

    喜欢:

    [self presentModalViewController:modalViewController animated:NO];
    modalViewController.view = modelView1;
    

    我认为这会起作用。

    希望这会有所帮助。

    谢谢,

    疯狂

    【讨论】:

    • 感谢您的回复,但它在两种方式都有差异。问题。
    猜你喜欢
    • 2012-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-27
    • 1970-01-01
    • 2016-06-03
    相关资源
    最近更新 更多