Reference iOS7 chevron back image for back button - ios

Can you reference the builtin images of iOS7 like the blue background image chevron? I am adding a custom back button to my navigation bar, but the chevron is missing.

Related

Swift How do I stop the tab bar from changing background colors

I'm working on a project that requires a Tabbar. Currently I have my code set up so that after login or sign up I'm presented by the Explore tab (The third tab). The goal I'm trying to achieve is to have my project only show a translucent tab bar background. When I was originally working on my project I had no issue doing this. I ran in the problem after I incorporated a table view that allow for scrolling. Currently when ever I push on the tab 1-4 I get a translucent background. When tab 5 (includes the table view with scrolling) is pressed the background of the tab bar changes to a gray color. Even if I press out of the tab to a different one the gray tab bar background color doesn't change. The only way I found to dismiss the back ground color after the 5th tab has been selected is to scroll all the way down. After I'm scrolled down it allows the user to see the translucent background again. Then you can select different tab bars and you'll see the translucent background again. How do I only show a translucent color
You need to set Bar-Tint colour to Default. ScreenShot

UIBarButton icon does not change when theme changes in iOS 13

I am facing an issue on iOS 13 where the UIBarButton icon does not change when I switch the iOS theme.
I have created two sets of images for dark and light themes and added them to xcassets as shown in the image below.
When I change the theme, the image of that theme doesn't reflect but if I tap on it then it changes.
Steps and screen recording.
Open VC1 in dark mode
Switch to light (icon should have black border)
Switch to dark (no change in icon)
Change to light (no change in icon)
Tap on icon, segue to VC2
VC2 shows its bar button with correct theme icon with black border
Tap on VC2 bar button
VC1 shows correct theme icon with black border
I tried creating new bar button and assign same icon without a segue. Icon doesn't change neither when theme changes not when i tap it.
below is screen recording.
What could be the reason?
Had the same problem today. Looks like you completed the first step (making sure you switch "Appearances" for the image set to "Any,Dark" or "Any, Light, Dark".
Turns out you need to set "Render As" to "Original". (See screenshot). Once I did this it worked.

How can I move UIBarButtonItem as image to the left side using it as menu button?

Whenever I try to set an image to a UIBarButtonItem, it gets put in the center of the bar. How can I move it to the left to use it as a menu button by setting the image of the button programmatically?
Set the left bar button image via your Navigation Controller in your storyboard instead.
Click on your Navigation Controller in Storyboard and ensure Navigation Bar is selected.
Choose your image for both Back and Back mask.
It can be fit to left of the NavigationBar button by "decreasing the resolution of image".

UIDocumentInteractionController - Change background Color and prevent status bar popup

When I use the UIDocumentInteractionController it's background color is always white in the beginning and when I tap it, it gets black (and back when tapped again).
Can I somehow invert this or even set a custom background color for both modes?
Another interesting bug is that once I touch the screen the status bar (which I have disabled) pops back up. So white screen with document --> tap screen --> black background with status bar --> tap white screen withs status bar.
Once I dismiss that UIDocumentInteractionController, I disable the status bar again but it looks really ugly.
I've got the info.plist set up correctly with UIViewController-wise decided status bar appearence set to NO.

Getting the right tint for back button

I am trying to achieve this look for my back button:
But no matter where I sample the shade of green in photoshop, it never comes out correct. For example:
Any suggestions on how I can achieve the exact same look?
The tint color is exactly that—a tint. iOS uses that color as a base to create a nice-looking button in the style of normal navigation bars.
If you want to control your button's appearance more precisely than tinting allows, your best bet is to create a set of images and use -setBackButtonBackgroundImage:forState:barMetrics: to use them. If you want this look for all bar button items in your app, use that method on +[UIBarButtonItem appearance], rather than a specific bar button item.
In order to produce the BackBarButtonItem's gradient, iOS does the following:
Applies the tint color that you specify
Applies a transparent overlay on top of the back button
Here are the retina-display overlays it uses for iPhone (these were obtained using UIKit-Artwork-Extractor):
Default Back Button Overlay
Pressed Back Button Overalay
Unfortunately, there is no way to tell iOS / UIBarButtonItem NOT to render these overlays on the back button (thereby, this gives the default navigation bar and buttons a pretty consistent look across all apps).
If you don't want to have this overlay applied (it will darken the button in both states), you have to create your own back button images - for the default and pressed states, portrait and landscape orientations, and retina and non-retina displays (8 total images).
As Brent Royal-Gordon mentions in his answer, you can apply these images using the appearance proxy for UIBarButtonItem to have them used throughout the app. In example, you'd set the default background image state like this for portrait orientation:
UIImage *defaultBackImage = [UIImage imageNamed:#"My-Default-Back-Button"];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:defaultBackImage forState: UIControlStateNormal barMetrics:UIBarMetricsDefault];
It looks like the button is adding another semi-transparent gray layer over the button. I can't check right now but I would look for settings to disable the semi-transparent layer effect or try different button style/states.

Resources