integrating-tuya-ios-theme
Installation
SKILL.md
概述 {#description}
涂鸦 iOS BizBundle 主题色体系通过 thing_custom_config.json 中的 colors(浅色)和 blackColors(深色)两段 JSON 配置驱动,也可在代码中通过 ThingThemeManagerProtocol 动态覆盖。
不配置主题的后果:BizBundle 内部页面颜色使用 SDK 默认值,应用无法与 BizBundle 页面保持视觉一致。
适用场景 {#scene}
已完成 integrating-tuya-ios-sdk 和 integrating-tuya-ios-bizbundle-framework,需要为 BizBundle 配置品牌色时使用。
步骤:
-
Podfile 添加主题业务包依赖:加入
ThingSmartThemeManagerBizBundle;执行pod update。 -
在
thing_custom_config.json中配置主题色:colors节点配置浅色主题;blackColors节点配置深色主题(可选,不填则深色模式下复用浅色值)。推荐只修改themeColor,其余使用默认值。详见references/theme-config.md。 -
(可选)代码中动态覆盖主题色:通过
ThingSmartBizCore获取ThingThemeManagerProtocol服务,在 App 启动完成后、业务包打开之前调用。详见references/theme-config.md。 -
(可选)配置深色模式切换:通过
changeThemeStyle:切换浅色/深色/跟随系统;监听主题变更通知刷新界面。详见references/theme-config.md。