uinavigationcontroller

uinavigationController's toolbar with custom items

我怕爱的太早我们不能终老 提交于 2020-01-03 02:30:12
问题 I am trying to use the NavigationController's toolbar in my app. This toolbar's toolbarItems are suppose to change depending on which view controller is presented. this is very basic. What I am trying to do is to add custom buttons to the toolbar using the UIBarButtonItem's "initWithCustomView:" method. However, the button won't show up on the toolbar. But if I create the UIBarButtonItem using the "initWithTitle:" or "initWithBarButtonSystemItem:" method, the button show up. For example, look

UINavigationController subclass - customizing Pop

笑着哭i 提交于 2020-01-03 02:20:21
问题 Like many others, I would like to perform an action when the 'back' button is used in a UINavigationController. I am aware of some alternative approaches to this, such as adding my own button and trying to spoof the look, using viewWillDisappear and setting tags on all non-back actions that will cause the view do disappear, etc. But the one that I would like to try is subclassing UINavigationController and injecting something in popViewControllerAnimated: But I can't get a simple test case to

How can I make the text of a UIBarButtonItem wrap to two lines?

为君一笑 提交于 2020-01-03 00:52:28
问题 Some of the titles of view controllers in my UINavigationController are quite long, which makes the back button in the navigation bar of the next view controller in the hierarchy miss out some of the text, with a "..." instead. How could I make the text of the back button wrap onto two lines, as with "Now Playing" in the navigation bar of iPod.app? Thanks! 回答1: You could use the UIBarButtonItem method initWithCustomView: then set the rightBarButtonItem property in UINavigatiobItem. 来源: https:

iPhone: Is it possible to have an 'info'-button in all views in my app?

北战南征 提交于 2020-01-02 21:00:16
问题 As mentioned in the title, how do I implement such a functionality? I am using the code below, (in my viewDidLoad), to get the button on my Navigation Controller of my main view. UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; [infoButton addTarget:self action:@selector(viewWillAppear:) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:infoButton]; Not sure how I can get it displayed in

uitableview + navigation controller set title from selected element

核能气质少年 提交于 2020-01-02 19:42:29
问题 I have a UINnavigationController that handles the navigation in a UITableView . When I select a row from the table I need to display in the UINavigationController title the selected item from the previous menu. The label of the cell is read from an external xml that fills the rows of the UITableView . How can I display my selection on the title of the UINavigationBar ? I've set a static title by using the self.title command, but it doesn't fit my needs 回答1: Would this work for you? - (void

Adding SearchBar to NavigationBar Objective-C iOS 9

陌路散爱 提交于 2020-01-02 05:40:08
问题 I think the title is pretty self explanitory. I have a tableView embedded in a navigation controller and want to add a search bar to the navigation bar. I think something changed in iOS 9 regarding searchbar controller things so keep in mind this has to be for iOS 9. This is what i have. No doubt it is wrong. UISearchController *searchController = [[UISearchController alloc]init]; self.searchController.searchBar.barTintColor = [UIColor whiteColor]; [self.navigationController

Reusing UIViewController for modal and non-modal situations

廉价感情. 提交于 2020-01-02 04:45:07
问题 I have a UIViewController — let's call it "FormController" — which is simply a form that edits an object. I want to use it in 2 different situations: Creating a new object — using using UINavigationController's presentModalViewController: method. Editing an existing object — push the view controller onto the UINavigationController stack, not using a dialog method. There is a slight difference in that in the modal situation I would like to have a toolbar with "Cancel" and "Done" buttons,

UINavigationBar with buttons as title.

牧云@^-^@ 提交于 2020-01-02 01:16:07
问题 I have done some digging and can't seem to get anything useful. What I am trying to do is pretty basic but I'm not sure if their is: 1. An easier way 2. Or if Apple will give it a "no no" I have a view that is controlled via UINavigationController (obviously from the title of this post) and in it has an object/view. The view is fairly congested already with content. Not really congested but no more room to fit things comfortably. The user needs to be able to rate this object by using a

Right To Left Push animation results in corrupted navigation bar

血红的双手。 提交于 2020-01-01 19:58:23
问题 I'm subclassing my UINavigationController to perform a push from right to left (not normal behavior) with UIRTLNavigationController.m I've added at the bottom of this question and get these warnings: nested push animation can result in corrupted navigation bar Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted. I've researched about these errors and found a class that prevents you from receiving them: https://github.com/Plasma

Right To Left Push animation results in corrupted navigation bar

两盒软妹~` 提交于 2020-01-01 19:58:07
问题 I'm subclassing my UINavigationController to perform a push from right to left (not normal behavior) with UIRTLNavigationController.m I've added at the bottom of this question and get these warnings: nested push animation can result in corrupted navigation bar Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted. I've researched about these errors and found a class that prevents you from receiving them: https://github.com/Plasma