uinavigationitem

How to Change back button title on navigation controller in swift3?

混江龙づ霸主 提交于 2019-11-26 23:42:24
问题 I want to change the title of backbutton to any name in swift 3.I tried many ways but none of them worked for me. self.navigationItem.backBarButtonItem?.title="Title" self.navigationController?.navigationItem.backBarButtonItem?.title="Title" Just for information i have written below code in appdelegate. let backImage : UIImage = UIImage(named:"backArrow")! UINavigationBar.appearance().barTintColor = UIColor(red: 0.0/255.0, green: 0.0/255.0, blue: 0.0/255.0, alpha: 1.0) UINavigationBar

Can't assign multiple Buttons to UINavigationItem when using Storyboard with iOS 5

随声附和 提交于 2019-11-26 21:56:59
I'm a iOS developer with a lot experience in developing the UI by code. I'm now testing the Storyboard functionality, because I testing to switch to "design" the UI rather then implementing it. In the past I stuck with to much limits using nib/xib's and therefore I never succeed with the switch. So here comes a new try with storyboading :) Now my question - I'm designing an iPad Storyboard which has a Navigation Controller and a Tableview Controller. I want to add multiple UIBarButtonItems, but I can just add one for each side with the Interface Builder. The code would look like:

vertically aligning UINavigationItems

China☆狼群 提交于 2019-11-26 20:59:42
问题 I have customized the UINavigationBar's height to 100px and I'd like to add buttons onto this customized bar. All is good except the button seems to want to sit on the bottom of the nav bar no matter what. I can't get it to align to the center or the top of the nav bar. Here is the code; first I create a navigation controller in the app delegate and add one button on the right. // set main navigation controller temp *tempc = [[temp alloc] initWithNibName:@"temp" bundle:nil]; self

Adding back button to navigation bar

岁酱吖の 提交于 2019-11-26 18:22:45
问题 I've added a navigation bar to a UIViewController. It is displayed from another UIViewController only. I'd like to have a left side back button that is shaped similar to an arrow, just like the normal navigation bar back button. It seems I can only add a bar button through IB. I'm guessing the back button needs to be added programmatically. Any suggestions on how I should do this? Currently, in the RootController, I push another UIViewController (viewB) by simply doing an addSubView. In viewB

Removing the title text of an iOS UIBarButtonItem

ε祈祈猫儿з 提交于 2019-11-26 18:04:52
What I wanted to do is to remove the text from the 'Back' button of a UIBarButtonItem , leaving only the blue chevron on the navigation bar. Keep in mind that I'm developing for iOS 7. I've tried several methods, including, but not limited to: This is the image method which I did not like (the image looked out of place): UIBarButtonItem *barBtnItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"iOS7BackButton"] style:UIBarButtonItemStylePlain target:self action:@selector(goToPrevious:)]; self.navigationItem.leftBarButtonItem = barBtnItem; Another method I tried was this, which

iPhone: Setting Navigation Bar Title

﹥>﹥吖頭↗ 提交于 2019-11-26 11:55:02
问题 Hey all. I\'m still pretty new to iPhone development, and I\'m having a bit of trouble figuring out how to change the title of my Navigation Bar. On another question on this site somebody recommended using : viewController.title = @\"title text\"; but that isn\'t working for me...Do I need to add a UINavigationController to accomplish this? Or maybe just an outlet from my UIViewController subclass? If it helps, I defined the navigation bar in IB and I\'m trying to set its title in my

UINavigationBar multi-line title

自作多情 提交于 2019-11-26 09:22:35
问题 Is there a straightforward way of overriding the titleView of the current navigation bar item in a navigation bar within a navigation controller? I\'ve tried creating a new UIView and replacing the titleView property of topView with my own UIVIew with no success. Basically, I want a multi-line title for the navigation bar title. Any suggestions? 回答1: Set the titleView property of the UINavigationItem . For example, in the view controller's viewDidLoad method you could do something like:

Can't assign multiple Buttons to UINavigationItem when using Storyboard with iOS 5

孤街浪徒 提交于 2019-11-26 09:08:02
问题 I\'m a iOS developer with a lot experience in developing the UI by code. I\'m now testing the Storyboard functionality, because I testing to switch to \"design\" the UI rather then implementing it. In the past I stuck with to much limits using nib/xib\'s and therefore I never succeed with the switch. So here comes a new try with storyboading :) Now my question - I\'m designing an iPad Storyboard which has a Navigation Controller and a Tableview Controller. I want to add multiple

Removing the title text of an iOS UIBarButtonItem

最后都变了- 提交于 2019-11-26 06:04:08
问题 What I wanted to do is to remove the text from the \'Back\' button of a UIBarButtonItem , leaving only the blue chevron on the navigation bar. Keep in mind that I\'m developing for iOS 7. I\'ve tried several methods, including, but not limited to: This is the image method which I did not like (the image looked out of place): UIBarButtonItem *barBtnItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@\"iOS7BackButton\"] style:UIBarButtonItemStylePlain target:self action:@selector

How do I change the title of the “back” button on a Navigation Bar

ぐ巨炮叔叔 提交于 2019-11-26 01:48:33
问题 Currently the left bar button default value is the title of the view that loaded the current one, in other words the view to be shown when the button is pressed (back button). I want to change the text shown on the button to something else. I tried putting the following line of code in the view controller\'s viewDidLoad method but it doesn\'t seem to work. self.navigationItem.leftBarButtonItem.title = @\"Log Out\"; What should I do? Thanks. 回答1: This should be placed in the method that calls