简体   繁体   English

更改导航栏按钮

[英]Changing navigation bar buttons

Hi I am making an app in Xcode 7 in Objective-C. 嗨,我正在用Objective-C的Xcode 7开发一个应用程序。 You know how in Cydia, when a user interacts with a web element in the webView , the navigation bar buttons change accordingly. 您知道在Cydia中,当用户与webView的Web元素进行交互时,导航栏按钮会相应地更改。 I have included photos below. 我在下面附上了照片。 How might I be able to do this? 我怎么能做到这一点?

About Button提供一个AlertController

About Button Gives an AlertController About Button提供一个AlertController

选择“精选”时,“关于”按钮将变为“主页”按钮

When "Featured" is selected, the About button changes to a back home button 选择“精选”时,“关于”按钮将变为“主页”按钮


What you are looking for is very basic iOS stuff. 您正在寻找的是非常基本的iOS设备。 Go through this Apple Documentation for detailed information. 查看此Apple文档以获取详细信息。

In essence, you need to create a navigation bar based application with two view controllers. 本质上,您需要使用两个视图控制器创建一个基于导航栏的应用程序。 From, first view controller, calling below two lines on any user action (tap on cell or button), would present second view controller on screen with Back button shown automatically by iOS. 从第一个视图控制器,在任何用户操作(在单元格或按钮上轻按)的两行下方调用,将在屏幕上显示第二个视图控制器,并由iOS自动显示“后退”按钮。

MySecondViewController *viewController = [[MySecondViewController alloc] init];
[self.navigationController pushViewController:viewController animated:YES];

This is just a glimps of how it works. 这只是其工作原理的一瞥。 You need to go through documentation to get more knowledge. 您需要阅读文档以获取更多知识。 Using Storyboard is another option. 使用情节提要是另一个选择。 Explore! 探索!

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

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