简体   繁体   English

iPhone App Dev - 将一个视图加载到另一个视图中

[英]iPhone App Dev - Loading a view into another view

I have a root view controller with just a simple navigation button that loads a questionview.我有一个根视图 controller,只有一个加载问题视图的简单导航按钮。 When I use pushViewController a back button appears.当我使用 pushViewController 时,会出现一个后退按钮。 Instead I want a custom button in the top right of the uinavigationcontroller and I want to remove the back button after the page transition.相反,我想要 uinavigationcontroller 右上角的自定义按钮,并且我想在页面转换后删除后退按钮。

how can i achieve this..我怎么能做到这一点..

Take a look at UINavigationItem.看看 UINavigationItem。 You can accomplish both your goals by properly configuring your view controller's navigation item.您可以通过正确配置视图控制器的导航项来实现这两个目标。 Use the -setHidesBackButton:animated: to hide the back button, and the -setRightBarButtonItem:animated: to add your custom button on the right side of the navigation bar.使用-setHidesBackButton:animated:隐藏后退按钮,使用-setRightBarButtonItem:animated:在导航栏右侧添加自定义按钮。

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

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