[英]UITableView not interacting after modyifing the bounds on a UIModalPresentationCustom
基本上,我试图呈现具有特定大小和位置的自定义模式视图,因为我能够通过iOS 7上的弹出窗口进行管理。但是在iOS上,它们似乎改变了一切。
我设法做到以下几点:
介绍:
UpViewController *upViewController = [[UpViewController alloc] init];
upViewController.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:upViewController];
navigationController.modalPresentationStyle = UIModalPresentationCustom;
[self presentViewController:navigationController animated:YES completion:nil];
在UpViewController.m中:
- (void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];
self.navigationController.view.superview.bounds = CGRectMake(-350, -30, 320, screenSize.height-(44+20));
}
我的问题是出现了模态视图之后。 我们无法与已添加到视图的UITableView进行交互。 有人遇到过这个问题吗?
似乎我找到了自己的解决方案而不是设置边界,而是设置了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.