tabview - Changing Tab Bar Color (Swift) -


I am trying to change tab bar color in a view controller in XCode using Quick View. I have a hex which is matching me to RGB value and I'm trying to set this code. (Which does not work)

  Color = euilolor (red: 41, green: 40, blue: 39, alpha: 1.0) UITBbar. Experience (). BarTintColor = color  

However this code does:

  UITabBar.appearance (). BarTintColor = UIColor.whiteColor ()  

Can anyone explain that this does not work, and what can I do to fix it?

This does not work because all your RGB components are more than 1, which is the maximum available value per-channel is. You are probably thinking about the bytes of color channels, but this color will not separate the bit depth. (For example, in the early versions of iOS, it was common to present RGB 8888, RGB565, and you might expect Apple to make a screen with 16-bit accuracy, in the near future.) Floats from 0 to 1 Divorce a little deeper than planned, color representation.

:


Comments