0

I currently have a navigation controller with a UINavBar within my view controller. I hide the navbar by changing the frame x position to a negative value. This hide's the navbar but the area under the navbar no longer responds to touch input. How can I fix this?

4

2 回答 2

1

您可以使用隐藏导航控制器

[self.navigationController setNavigationBarHidden:YES animated:YES];

这样你的视图就会调整大小。

于 2013-06-29T02:29:52.087 回答
0

一种更简单(也更直观)的方法是简单地修改 View Controller 设置。您可以通过转到Utilities菜单,选择Attributes Inspector,然后将“Top Bar”设置为None来删除 NavBar 。确保在 Storyboard 中选择了正确的 View Controller。

显然,如果您不使用情节提要,这对您没有任何好处。在这种情况下,请使用 Danilo 的解决方案。

于 2013-06-29T02:33:59.137 回答