简体   繁体   English

修改UIModalPresentationCustom的边界后,UITableView不交互

[英]UITableView not interacting after modyifing the bounds on a UIModalPresentationCustom

Basically, I am trying to present a custom modal view with a specific size and position since I was able to manage this through popover on iOS 7. But on iOS it seems they change things. 基本上,我试图呈现具有特定大小和位置的自定义模式视图,因为我能够通过iOS 7上的弹出窗口进行管理。但是在iOS上,它们似乎改变了一切。

I manage to achieve this with the following: 我设法做到以下几点:

Presentation: 介绍:

            UpViewController *upViewController = [[UpViewController alloc] init];
            upViewController.delegate = self;

            UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:upViewController];

            navigationController.modalPresentationStyle = UIModalPresentationCustom;

            [self presentViewController:navigationController animated:YES completion:nil];

In UpViewController.m: 在UpViewController.m中:

- (void)viewWillLayoutSubviews
{
    [super viewWillLayoutSubviews];

    self.navigationController.view.superview.bounds = CGRectMake(-350, -30, 320, screenSize.height-(44+20));

}

My problem is after my modal view has been presented. 我的问题是出现了模态视图之后。 We cannot interact with the UITableView that has been added to the view. 我们无法与已添加到视图的UITableView进行交互。 Anyone has encounter this problem? 有人遇到过这个问题吗?

Seems I found my own solution instead of setting the bounds, I set the navigationController.view.frame: 似乎我找到了自己的解决方案而不是设置边界,而是设置了navigationController.view.frame:

- (void)viewWillLayoutSubviews
{
    [super viewWillLayoutSubviews];

    self.navigationController.view.frame = CGRectMake(screenSize.width-320, 44, 320, screenSize.height-(44));

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM