I'm using tabbar with four tabs with title. I'm setting different color for selected and unselected tabs. But only for the first tab, the selected and unselected colors & title are getting overlapped. Whenever I'm selecting first tab, title is getting added again and again. I have attached screenshot as well.
In storyboard
Anyhelp could be appreciated. Thanks in advance.
You problem is most likely from the color you use for unselectedItemTintColor, which you have set to have transparency. This color should probably be solid. Try changing it to a solid version of what you want to see, like #EB989E.
Also be aware that you are setting an internal property, and as such it may change or disappear in a future release of iOS.
Related
I've created a custom tab bar icon and made sure to set the background to transparent. The outline of the icon highlights when selected, but doesn't fill as system icons do.
From the Human Interface Guidelines manual:
Provide two versions of custom tab bar icons. Provide icons for both
the selected and unselected states. The selected icon is often a
filled-in version of the unselected icon, but some designs call for
variations to this approach.
My question is after I created the two versions of the icon as directed, how do you set it?
Using storyboard you need to select your tabViewController and define the tab item properties according your needs
Hope this helps you
I am using storyboard to lay out my iOS app. I want to re-use some colors, and I don't want to re-enter the same hex string multiple times. What is the best way to do this?
You can drag the current color in the color picker (from the bottom left) to the list of swatches as in the screenshot:
You can also use the dropdown for picking a color to use a recent color. The list of recently used colors looks like it keeps 24 of them.
I'm using Xcode 6.
My app ist by default all white background and black text, text that is present in the title of the nav bar, the table views content, and the tab bar for example.
I would like that all my views (the tab bar and nav bar too) to be dark gray and hence all the text previously mentioned to be white.
Should I set it up for each view of my numerous view controllers, or there is a way to set it up for all the views of the app ?
Thanks for the advice and help
The right way would be to set it up everywhere manually yourself. Because it will be helpful for people in the future to see what you are doing and where.
Another way, which is equally correct would be to create your own customUIViews which would by default channge their colors to grey, and customUITextField which will turn their text white and same goes for labels.
Or use Categories on top of the existing classes of UI, and create a function setUpColor/setupFontColor, and call that function everwhere you want. (I would personally go with the very first solution.)
I have really weird problem with colors in interface builder. I set a color on one UI element, for example UIView, and then I want the same color on UIButton...but when I try to do so, colors are often different - I mean little bit different tone, not absolutely different color. How is this even possible ??? I've tried to use RGB sliders, and other sliders, also that color picker tool... Only thing that helps me sometimes is, when I create new UI element. Anybody had the same problem and knows what's going on ?
Interface Builder filters colors through your monitor's current color space by default. You can change this in Xcode4 IB by bringing up a Colors dialog, clicking the Sliders tab, then clicking the little dropdown button under the magnifying glass that looks like a color spectrum. This will bring up a list of available color spaces -- select Generic RGB and adjust the sliders as necessary to get the correct color.
See this question for more information, especially the comments on the accepted answer.
I solved this issue using "Device RGB" instead "Generic RGB".
See the image:
Unfortunately, fiddling with color spaces didn't work for me. What did work was editing the raw xml of the .xib (right click .xib, Open As > Source Code) and changing the RGB decimal values there.
The currently selected item in interface builder will be slightly different to its actual colour - it has a darkened mask applied to it to highlight the fact that it is selected. You need to click somewhere else in the window to unselect the item, it's real colour will then be shown. I've fallen into this trap myself.
Is there an option for a button/image to set, that it will always be shown on top? So I have 2 buttons and want to add an image. But the image covers the two buttons and I have no idea how I could get the image in the background or the buttons in the front.
BTW: I´m fairly new to xcode and programming...
Use the xCode top menu item Editor->Arrange. There you have options to handle z index for controls.
What I did was, to have two button one for the label and one for the image and when one is clicked it propagates the message to the other and does the action depending on which one was clicked.