I have got a navigation bar with a controller. I want an 'hamburger' icon on the right bar button.
Its an PNG file.
When I add it on Interface builder its blue :(.
I have been messing with the Tint colour and that changes the whole image. So if I want it green i just change the Tint color. But I want the colour to come from the png and not from the tint. I have tried using clear tint colour and that just makes it disappear. Any ideas on this quick one ?
You can't change the color with the PNG. As Apple says here:
If you create a full-color template image, iOS ignores the color.
So you have to change it in the storyboard or programmatically, like this:
Tab Bar:
UITabBar.appearance().selectedImageTintColor = UIColor.orangeColor()
Navigation Bar:
UINavigationBar.appearance().tintColor = UIColor.orangeColor()
Related
I've been through most to all of these SO Q/A and none of which worked; many refers to older version of xcode.
I'm using Xcode 8. I have a TabBarItem with a red image. Other item image will have a different color. For the first item, the selected image is originally red. When I run the app, it's blue -- it should be selected as red, why it's blue?
In Story Builder -> Identity Inspector -> Runtime attr, I have tintColor - Color - (red color). None of that worked. My image is red so why it's not red? Do I need to disable a default setting somewhere?
Is there a way when I select any image, it shows the original color it was saved?
A post's comment mentioned setting the image in viewDidLoad is bad. Is that true? I've tried that and it's still selected blue.
This question is about selected image.
Thanks
When I run the app, it's blue -- it should be red, why it's blue?
That's because blue is the tint color. If you want to use the red of the original image, and not the tint color, turn the image into a rendered image with rendering mode alwaysOriginal. If this is supposed to be the color only when the tab bar item is selected, supply it as the selectedImage.
I'd like to make an NSToolbarItem with a custom image which toggles between Black and Blue, like the icons at the top right of Xcode 5's main window.
Peter Hosey suggested in this answer that it was as simple as setting the image to be a template, but I haven't found that to be the case. I set it to a template image, and that causes it properly render the dark gray gradient, but it doesn't render in blue when toggled.
I uploaded a very simple example of what I've done, here. If someone could tell me how to change it to light up the NSToolbarItem in blue, as Xcode does, then I'd very much appreciate it.
You mostly have everything you need in place, with the exception of providing an NSButton object using the style NSTexturedRoundedBezelStyle, with which you’ve associated your image.
↳ modified example project here
⌘ OS X Human Interface Guidelines | Window-Frame Controls
Have any one else noticed in iOS7, the translucent navigation bar only shows color underneath if barTintColor is set to default?
I tried setting barTintColor to various different colors, but anything that is below the navigation bar is displayed a a black blur. Whereas if the barTintColor is set to default, all the elements display correctly underneath.
Is there a way to force it to show the correct colors?
You have to use background color instead of tint color.
self.navigationController.navigationBar.backgroundColor = [UIColor yellowColor];
If you are using tint color it changes only barbutton background color change.
In MyTabBarController in the storyboard select the color tint. You will change the button active color background. No idea for the inactive one.
I want to implement an animation which is like the sync animation of evernote app on Max OS X.
The button looks like:
When the animation runs, only is the white arrow rotating.
I tried to use Core Animation, and the steps are following:
1 I dragged a NSButton to the tool bar and set it to an outlet aBtn. I set the blue blackground image to the aBtn.
2 I created a CALayer instance variable aLayer and add it to the aBtn. So it can look like the button above.
3 when aBtn was clicked, I add the rotation animation the aLayer. It run perfectly well.
The problem is when I want to customize the tool bar, the aBtn shown in the tool bar palette didn't have the aLayer and only had the blue background image.
Then I tried to find the event or notification for the showing or closing of the tool bar palette. As a result I can reset the image of the aBtn before the tool bar palette was shown or hidden.However, I couldn't be notified when the tool bar palette was closed.
Could any one give any suggestion?
If you have good idea about how to implement this animation, please let me know.
Thanks!
I create a gif to store the animation, and create an NSImageView for the gif. Then I use -[NSToolBarItem setView:].
Using gif is an easier way than implementing it with Core Animation.
I have a white png image, which is a part of a n icon.
I would like to change it's colour to get a coloured icon.
I know it is possible with hue/saturation setting, but don't know how to achieve a specific colour output.
I am using Axialis Icon Workshop (I have Photoshop CS5 also). The colourize option along with Hue, Saturation and Brightness adjustments will assist getting any colour output. But I specifically want colour #3366CC.
Is there a solution to convert my white png image to #3366CC coloured image?
This can be easily achieved if you go to the layers panel in Photoshop and select your icon layer. If the icon has a transparent background then select the fx button from the bottom of the layers panel and select color overlay or go to the menu at the top of the Photoshop screen and select Layer > Layer Style > Color Overlay. From the options box select the color box and put in 3366cc instead of the ffffff you have.
This should give you a coloured icon as desired. If this doesn't work let me know and I'll try to help.
You can go to layer style and choose color overlay, but that wont give you the color as you exactly want it, you can go a step further and hold the control key and click on the shape or the image you want to change the color, the shape will be selected, make a new layer on top of the shape or image that you want to change the color then fill in the color with the color that you choose in the layer property and set the mode to overlay, reduce the opacity to 50%. done