How to change dynamically color used in UIStoryboard

后端 未结 2 541
悲&欢浪女
悲&欢浪女 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: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

提交回复
热议问题