Back button showing as different colour on screen? - ios

To experiment with the back button in a navigation controller set up, I added a button programmatically without using storyboard and without using the default navigation bar and back button you get for free with the navigation controller.
In App Delegate I simply said:
navigationController.isNavigationBarHidden = true
I set the button to a simple black and white image icon - but when I run it in the simulator the image shows as blue.
Does anyone know why this might be? It seems to still be picking up the navigation controller colour of blue but I have set the NavigationBarHidden to be true.

from assets, make sure the photo is selected and go to attributes inspector and change “render image as” to Original, same applies for tab bar items images

Related

how can I change the tint color of the barButtonItems in the STPPaymentOptionsViewController and STPAddCardViewController?

My goal is to be able to change the color the tint color of the bar button items in the Stripe integrated view controllers. The STPCoreViewController is responsible for basically all the STP view controllers but it says you shouldn't inherit it in your own app, plus even if you could the class isn't fully open, it has a public access level.
I know if it was any other view controller, you'd just set the navigation bar tint color to white, but for some reason I can't figure out how to get access to these bar button items.
The STPViewControllers can be either presented modally or pushed, right now I have the STPPaymentOptionsViewController being pushed when a button is pressed. When it loads, the vc looks like this :
For some weird reason it basically inherits the background color, text color, and font from the Vc it was pushed from, but it won't inherit the colors of the bar button items. The same thing happens with the Add Card Vc:
Even when the vc is presented, it still presents full screen but the navigation bar title is large and black, and the background is white with the system blue bar button items. How can I fix this?
You can configure the NavigationBar buttons with accentColor on an STPTheme instance: https://stripe.dev/stripe-ios/docs/Classes/STPTheme.html#/c:#M#Stripe#objc(cs)STPTheme(py)accentColor
Here is my example of me setting
theme.accentColor = UIColor.red

iOS 10 selected TabBarItem disappears

I have an app that uses TabBar based navigation inside a storyboard to navigate to different views.
The app worked fine from iOS7 - iOS9. But with iOS10 the tab item disappears when it gets selected (icon and title).
The tab bar is completely configured in the story board, no custom user code. In XCode everything looks fine:
But when the app is run on a iOS10 device/simulator the app looks like the following (the image shows different selections in the same tabbar, the behavior is the same for all 3 items)
What could be the cause for this issue? Are there any work arounds?
I finally found a solution to this issue. I am still not sure if this is due to a change or a bug in iOS 10.
Taken from this reply to an old question:
https://stackoverflow.com/a/39884669/1567923
You need to create a custom TabBarViewController and use it in your storyboard.
And in that view controller do something like that, to set the tintColor in code directly:
class UIMeeetTabBarController: UITabBarController, UITabBarControllerDelegate{
override func viewDidLoad() {
super.viewDidLoad()
self.tabBar.tintColor = Style.colorRed
}
I hope this will work for you too.
Select your tabbar from tabbarController scene and set some tintColor under the view and then check if it works!
You don't need to set up a custom tab-bar controller. The problem here is missing documentation (for which I filed a bug report with Apple and encourage you to do the same).
You can fix this in Interface Builder by selecting the tab bar itself and then going to the "Tab Bar" (top) section of the Attributes inspector and setting the "Image Tint" color. I presume that when a tab-bar item enters the "selected" state, the control inverts the alpha channel of the graphic and lets the color of the underlying tab bar show through. If that color is "clear" or matches your tab-bar item's background exactly... you see nothing. If you have a dark background, try setting this value to white.
The graphic for tab-bar items is displayed using only its alpha (non-transparent) pixels as a black-&-white image. These pixels will then allow the "tint" of the underlying tab bar to show through or not, depending on the unselected/selected state.
I know this is an old one, but I faced the same issue in Xcode 9, and finally solved it without a single line of code. Go to the Attributes Inspector and make the Tab Bar Item Selected Image match the Bar Item Image...

How to completely remove back button from navigation bar?

For some reason I'm adding left and right buttons to the navigation bar as its subview instead of using navigation item. When pushing a view controller, I'm setting its navigationItem.hidesBackButton to YES so that the ugly looking blue 'back' button will not show up. The problem I'm facing is that, after tapping my own back button, while the currently showing view controller being popped --- I mean during the animation of the 'pop', I can see a '...' in the navigation bar moving right along with the popped view controller. And, I DON'T want that '...' to appear for even 0.0000000001 second. What may I do now? Any hint would be appreciated.
Note:Problem solved with just comment. But posting this as answer so that It will help someone else having same issue.
I too had same problem with navigationBarButtonItem while adding custom barButtonItem to navigationBar in storyboard. If you are also using storyboard then just set navigationBar tint color as clear color in navigationController. By setting clear color, that weird default navigation back button will not appear anymore.

Changing UINavigationController Back Button Image Issue

I am trying to change the navigation controller back button, but am facing problems with the image not being inline. I have removed the text by clicking on the navigation Item in the view controllers and changing the back button text to a single space " ".
Then I change the navigation bar back image to my custom one in the Navigation Controller scene.
But the image is not inline.
Does anybody know why this is or what are the best practises to change the back button image.
Id suggest you take a look at your image and make sure the back arrow is correctly positioned in the image. That may be what is causing it look like it is push upwards.
Alternatively, you could use:
[[UINavigationBar appearance] setTitleVerticalPositionAdjustment:(float)0.0 forBarMetrics:UIBarMetricsDefault];
Which would change the vertical positioning of your title to match the image. However, it may the make your rightBarButtonItem to look out of place.

How can I edit top status bar at AppleWatch?

I'm beginning with WatchKit and I would like to know hoy to edit the aspect of topbar in a AppleWatch app. I would like to change the color and also to hide it in some of my views because I want to focus my user to perform one action.
Thanks!
It is impossible to edit the status bar appearance. There are some strong restrictions:
Status bar cannot be hidden
There are not ability to modify the black background
You cannot add or modify the back button or another image
The only thing you can do is to change the title color using tint color in your storyboard and the text both of through storyboard and source code.
Change color
Change text
[self setTitle:#"MyTitle"];

Resources