TintColor UIImageView doesn't work with storyboard, but works with code

Xcode 9 beta 6, iOS 11

I uploaded logo Instagram, which is a file .png , and I have made UIButtonand UIImageViewin Main.storyboard. The logo image was set as follows:

Set mode

And I set TintColorfor UIButtonand UIImageView- white, but when I start the project, the image color for UIImageView remains black and white for UIButton.

ImageView setup:

enter image description here

black color

Why is it black for imageViewand white for buttonwith the same image setting? Thank you

Additional notes:

When I used the code to add a subview imageView, it worked well. Really weird!enter image description here

+10
4

Xcode 9.4.1

tintColor :

enter image description here

+3

-, , , xcassets , ( ). . , .

  • UIImageView
  • UIImageView
  • TintColor
0

, Global Tint :

Global tint color

0

tintColor AppDelegate.

I did not get the correct color cast on iOS 13 Xcode 11 in dark mode. However, the same hue color of the image looked correct when the toolbar button was installed.

I solved this by setting the Rena Asa property of the image as a Template Image in images.xcassets. I did not have to delete the UIImageView in the storyboard, nor add it again, nor add a custom property.

0
source

Source: https://habr.com/ru/post/1685199/


All Articles