FAQ Database Discussion Community


Pressing back button (backBarButtonItem) in KIF?

ios,ios8,uinavigationcontroller,uinavigationitem,kif
Does KIF provide any special support for tapping back buttons or will I have to do something like this? // in parent ViewController self.navigationItem.backBarButtonItem.isAccessibilityElement = YES; self.navigationItem.backBarButtonItem.accessibilityLabel = @"Back"; // in test class [tester tapViewWithAccessibilityLabel: @"Back"]]; The latter would be a bit unfortunate, because my code currently does not have...

The NavigationItem's TintColor can not be set

ios,swift,uinavigationitem
My Situation: There are a View_A (UICollectionViewController&UICollectionViewCell) and View_B (UIViewController). I want to switch to the View_B when I touched one of cell in the View_A with Segue in the StoryBoard. In the StoryBoard, I connected View_A and View_B with the Push Segue which identifier is SegueToView_B. And the function...

How to customize iOS UINavigationItem?

ios,objective-c,uinavigationbar,uinavigationitem
I suppose that this is duplicate, but after a research I can not understand how to customise UINavigationItem. I have custom ViewController (VC) which implements custom class SWRevealViewController (I need to create sliding menu). I have Menu VC and for each element of the menu I have Navigation VC with...

Navigation Bar Back Button Arrow Font Swift

swing,uinavigationitem
So I manage to change the font of the back button as said in this post but now I have two arrows(<), one is the back button default arrow and the other is the button title arrow ("< Back"). How do I remove/change the back button default arrow to the...

What method actually got called when we set self.navigationItem.hidesBackButton = YES;

ios,uinavigationbar,uinavigationitem,runloop
I am curious what method actually got called when we set self.navigationItem.hidesBackButton = YES/NO;. I'm curios because the property is not a method, when we assign to any value what actually running on the background, so it can hide or show Back Button immediately. I have been thinking there is...

Fill Color gap between Navigation bar and Carrier details in Swift

swift,ios8,uinavigationbar,uinavigationitem
Attached screen shot shows clear gap between carrier details and Navigation bar, How to fill the same red color and change the text of carrier details , time displayed to white color ? ...

How to change background color of UINavigationItem?

ios,iphone,swift,uinavigationitem
I have a UINavigationItem, but I can't found anything beside tittle, prompt, and back button in attribute inspector I wonder how can I change my UINavigationItem background color using code? or programmatically?...

How to change UINavigationItem font?

ios,swift,uinavigationitem
I am trying to change font property for UINavigationItem. I've tried using titleTextAttributes but somehow I am only able to change title font. How can I change the font or UINavigationItem ? For example, the "More" text for the Back UIButton shown below: I've tried using: self.navigationController?.navigationBar.titleTextAttributes = [ NSForegroundColorAttributeName:...

UILabel as subview of UIBarButtonItem.customView not dimming when presenting view controller

ios,uinavigationitem,rightbarbuttonitem,uibuttonbaritem
I have an issue where UILabel in the navigation bar is not being tinted properly when a view controller is presented modally. The UILabel is in the navigation bar, as a child view of a UIButton, which is a child view of the UIBarButtonItem, which is the rightBarButtonItem of the...

Custom UIView as navigationItem title

ios,uiview,interface-builder,xib,uinavigationitem
I want to create simple custom view and use it for navigationItem.titleView. My custom view is very simple, has only image view and label: [image]-[label]. I have xib file where I have defined all constraints (both subviews has constraint to superview - I want to height and width of subviews...

Bar Button Item Issue

ios,xcode5,uibarbuttonitem,uinavigationitem
I have a Bar Button called SAVE when the program running its automatically displays the title of SAVE but while i edit the contents in that particular view, the title should be changed as EDIT is there any codings are available for it?

UINavigationItem setLeftBarButtonItems Delay

ios,objective-c,uinavigationitem
I have a rather confusing problem: In my application I am checking for network connectivity and if the user is not connected to the internet I am showing a little red exclamation mark in the navigation bar. The Code that is used to show the exclamation mark looks like this:...

Navigation bar titleView alignment

ios,iphone,swift,alignment,uinavigationitem
I want my navigation bar to show two things in the middle. One them is going to be List name, and the other one will be name of users. User names will be placed under list name. What i have done so far is, i created two label and one...

Managing a transition from a normal NavigationBar to a transparent one

ios,objective-c,uinavigationcontroller,uinavigationbar,uinavigationitem
I need to manage the transition between two ViewControllers embedded in a NavigationController that uses the standard, light, blurred layer. All of the ViewControllers in this part of the app looks really good with this blurred layer except for one whereas I want it to fade over to become a...

Get the frame of UIBarButtonItem in Swift?

ios,swift,uibarbuttonitem,uinavigationitem
how could I get the frame of a rightbarbuttonItem in swift? I found this : UIBarButtonItem: How can I find its frame? but it says cannot convert NSString to UIView, or cannot convert NSString to String : let str : NSString = "view" //or type String let theView : UIView...

Dynamically change NavigationBar Back Button Text from presented ViewController

ios,objective-c,uinavigationbar,back-button,uinavigationitem
I'm trying to change the back button text on a UINavigationBar upon receiving something from the network - basically replicating iMessage/FB Messenger by adding a new message count to the back button text ie. < Back (1) or < Messages (2) I can change the back button text from the...

Custom Back Button for Navigation Bar

ios,iphone,uinavigationcontroller,uinavigationbar,uinavigationitem
I made a category of UINavigationBar as follow: UINavigationBar (UINavBar_Category) I want to create custom back button using this. I can able to set image by following code: [[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:@"btn_back.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; Problem can not able to change title of back button. My try - (void)didMoveToSuperview { UIBarButtonItem...

wrong Layout for replacing UiNavigationItem.Title with UITextField

ios,objective-c,uitextfield,autolayout,uinavigationitem
i wont replace the UINavigationItem.title with UITextfield. to make this i add in viewDidLoad the TextField UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 30)]; textField.text = @""; textField.placeholder = @"set title here"; textField.font = [UIFont fontWithName:@"Futura-Medium" size:19.0]; textField.textColor = [UIColor whiteColor]; textField.textAlignment = NSTextAlignmentCenter; textField.autoresizingMask = UIViewAutoresizingFlexibleWidth; textField.translatesAutoresizingMaskIntoConstraints = NO;...

Adding Navigation Item in UIViewController

objective-c,uiviewcontroller,uinavigationitem
I'm trying to add UINavigationItem to my UIViewController as mentioned this answer. However the Navigation bar is not showing in my view. I tried even adding an outlet and setting the title programmatically and also adding the NavigationItem in two different places. Still it doesn't show. This view controller is...

IOS rightBarButtonItem on UINavigationController in swift

ios,swift,uibarbuttonitem,uinavigationitem
I'm trying to put a rightBarButtonItem on a second view controller of an UINavigationViewController stack. I'm creating and setting the button in viewDidLoad of the view controller that I want to show. My actual code looks like this: override func viewDidLoad() { super.viewDidLoad() menu_button_ = UIBarButtonItem(image: UIImage(named: "menu"), style: UIBarButtonItemStyle.Plain...

UI glitch (black flicker) on right side of navbar during transition

ios,swift,uinavigationbar,uiviewanimation,uinavigationitem
I have an app that has a uipageviewcontroller that is presented on initial launch of the app. On the last page of the uipageviewcontroller I present the main navigation controller with a TransitionCrossDissolve animation. While the animation is ongoing I get a tiny black background flicker on the right side...