UINavigationController 更改推送的 UIViewController 视图的位置
我尝试了很多方法来解决这个问题,但总是失败。
基本上我需要的是一个带有自定义导航栏(不同高度和较小的后退按钮)的导航控制器,我已经实现了。
这会产生两个问题。如果我使用导航控制器的默认导航栏,我有一个较小的导航栏,但推送的 ViewController 的视图仍然处于位置,就好像导航栏具有通常的高度一样。另一方面,如果我使用自己创建的导航栏并隐藏默认导航栏,则推送的 ViewControllers 位置的视图就好像我根本没有任何导航栏一样。我不知道在哪里设置视图框架。无论我尝试在哪里设置它们,它都不起作用。
是否有任何策略无需从头开始实现自己的 NavigationController?
不使用 nib 文件,针对 iphone OS 4.0 的开发,但很快就会再次切换回 iphone OS 3。
I tried to solve this in so many ways but always failed.
Basically what I need is a NavigationController with a customized NavigationBar (different height and smaller back Button) which I already achieved.
This creats two problems. If I use the default NavigationBar of the NavigationController, I have a smaller NavigationBar but the views of the pushed ViewControllers still position as if the NavBar would have the usual height. If on the other hand I use my a self created NavBar and hide the default one, then the views of the pushed ViewControllers position as if I wouldn't have any NavBar at all. I don't know where to set the views frame. No matter where I try to set them, it doesn't work.
Is there any strategy without implementing an own NavigationController from scratch?
Not using nib files, dev for iphone OS 4.0 but will switch back to iphone OS 3 quite soon again.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用您自己的自定义导航控制器并在其
ViewWillAppear
方法中设置推送视图的框架。隐藏常用的导航控制器会产生问题。如果您不打算使用它,最好不要完全使用它。但完成此操作后,您将必须在项目中的任何位置使用自定义的导航控制器。
Try using your own customized Navigation controller and setting the frame of the pushed view in its
ViewWillAppear
method.Hiding the usual Navigation Controller will create problems. Its better NOT to use it completely if you do not intend to use it . But after doing that , you will have to use your customized Navigation controller in the project wheresoever.