I currently have the bottom safe area's color set as blue by setting the view's background color as UIColor.blue
However, the problem is when the keyboard comes up as a first responder, I still get a slight tint of that blue coming through from that background. Is there a way to make this translucent keyboard not happen?
I have a UILabel that whose background I want to set to black with alpha component so that this label can have a transparent black background.
In the storyboard when I set the background to the colour I want with an alpha component even the text of the label that is in white colour becomes lighter with the alpha component.
To overcome this problem I embedded the label in a UIView and even then the same problem persists.
How can I overcome this problem. Any help will be appreciated.
You can Do only With label make IBObject an write following line.
label.backgroundColor = UIColor.black.withAlphaComponent(0.4)
Instead of changing the alpha value, change the opacity of the label background color in storyboard.
For better understanding, I have taken an imageView and placed a label at the bottom of imageView and changed the background color of the label and textColor to white. At this stage you can't see the image behind the label.
Now, go to attributes inspector and select the label background color. There you can see the opacity and change it's value. Here I have made it 50%, you can change it to whatever you want between 0 to 100 until you get your desired transparency.
create the UIview with black background color and add the UIlabel inside the view and set the alpha to 0.5 of view . finally you get the black transparent, for e.g
if you need the label text in bold change the view hierarchy
place the UILabel fist then add the UIView.
Place the UILabelabove the UIView, not inside it.
Assume that we are talking about v1 the view that contains your label , if v1 is over another view that has bright colors then when your v1's alpha get lower your label white text color will become harder to see , the text color has nothing to do with the background alpha component , so you need to reconsider using the white color or the alpha component background or the view that is behind v1 make it darker that's all we can say
It is not difficult to change the background color of the table view and every single cell. The difficult part is to animate this change with a sliding effect. As the dark color slides from the top of the screen to the bottom, you also have to coordinate the color change of the navigation bar and tab bar. Any ideas possible solutions?
Both background and border color are set to white, there is no gray color in my code anywhere.
But when I set views cornerRadius I see two gray lines left and right from the view(sometimes up and down too, depending on the UIViews function)
Although when I set views backgroundColor to clear, lines disappear. Any reason for this to happen?
EDIT:
This only happens on iphone device, not on simulator, dont know why :/
Here I have one big white UView and 8 smaler ones inside it, and I am using constrains for the autolayout(but no problem there), and when I set all of these small views background color to clear, they disapear(also this big white view is responsible for the few of these gray lines)
And solution to the problem is either removing cornerRadius or seting background color to clear.
I've got a pretty straightforward question and somehow I didn't find an answer on this site yet.
I've got a view with a background a yellow color. I'm displaying content in the view and in order for the statusbar to not conflict with the content, I want the background to be non-transparent and preferably set to specific color.
How do I do this with storyboards?
The only way I see is to add a 20 height view aligned to the top of the view to act as a status bar background.
20 is the current size of the status bar but it's better if u get it programatically.
[UIApplication sharedApplication].statusBarFrame.size.height