How to change dynamically color used in UIStoryboard

后端 未结 2 540
悲&欢浪女
悲&欢浪女 2021-01-24 16:14

I wonder if it\'s possible to assign a \"dynamic\" color in storyboard.

Since iOS7 you can use a tintColor and change it programmatically via the tintColor of the keyWin

相关标签:
2条回答
  • 2021-01-24 16:53

    I finally found the solution.. (had to wait for the tool to exist :p).

    Crayons is an Alcatraz allowing you to re-use some code define color in Storyboard! yeah!

    check it out: https://github.com/Sephiroth87/Crayons

    0 讨论(0)
  • 2021-01-24 16:57

    Using asset catalog colors in Storyboards

    Using asset catalog colors in a Storyboard or an Interface Builder file is pretty straightforward. All color fields, including view background colors, label text colors, should display the colors you defined in the asset catalog under the “Named Colors” section.

    Now, access it in storyboard in color palettes

    Reference: https://blog.zeplin.io/asset-catalog-colors-on-xcode-9-c4fdccc0381a

    0 讨论(0)
提交回复
热议问题