Global IM UIKit 主题定制
主题由 ChatUITheme 统一约束:palette(颜色)、typography(字体)、layout(布局)三组令牌,提供浅色 / 深色预设。组件只读令牌,不硬编码颜色,因此换肤不需要改组件源码。
palette
typography
layout
- 浅色/深色两套预设
- 动态字体(Dynamic Type)
- 宿主可整体覆盖或按组件覆盖
- 运行中切换主题即时生效
var uiTheme = IMPChatUITheme.light
uiTheme.palette.brand = "#4F46E5"
print(uiTheme.palette.background)
IMPOSGlobalChatUITheme *theme = [IMPOSGlobalChatUITheme globalLight];
theme.palette.brand = [UIColor systemIndigoColor];
theme.layout.bubbleRadius = 16;
IMPOSGlobalChatUITheme *dark = [IMPOSGlobalChatUITheme globalDark];
listViewController.theme = theme;
相关:Dynamic Type、ChatUITheme。