UIKit 外观的封装。
要运行示例项目,先从仓库克隆,然后从 Example 目录运行 pod install
。
Objective-C
#import <HaidoraThemeKit/HaidoraThemeKit-Swift.h>
//or #import <XXX-Swift.h>
[HDThemeKit setupThemeWithPrimaryColor:[UIColor redColor] secondaryColor:[UIColor whiteColor]];
//自定义某一类
[UIXXX applyHDTheme:XXX]
Swift
HDThemeKit.setupTheme()
//or HDThemeKit.setupTheme(primaryColor: UIColor(red:0.314, green:0.420, blue:0.471, alpha: 1), secondaryColor: UIColor.whiteColor())
//自定义某一类
UIXXX.applyHDTheme(XXX)
可以通过 CocoaSeeds 来安装。Seedfile 如下:
github "Haidora/HaidoraThemeKit", "0.1.0", :files => "Pod/Classes/*.{swift,h}"
下载最新标签 并将源代码拖入您的 Xcode 项目中。
UIActivityIndicatorView
UIActivityIndicatorView.appearance().activityIndicatorViewStyle
- activityIndicatorViewStyleUIActivityIndicatorView.appearance().color
- activityColorUINavigationBar
UINavigationBar.appearance().tintColor
- navigationItemColorUINavigationBar.appearance().barTintColor
- navigationBackgroundUINavigationBar.appearance().barStyle
- navigationBarStyleUINavigationBar.appearance().titleTextAttributes.NSForegroundColorAttributeName
- navigationTitleColorUINavigationBar.appearance().titleTextAttributes.NSFontAttributeName
- navigationTitleFontUIPageControl
UIPageControl.appearance().currentPageIndicatorTintColor
- currentPageIndicatorColorUIPageControl.appearance().pageIndicatorTintColor
- pageIndicatorColorUIProgressView
UIProgressView.appearance().progressTintColor
- progressTintColorUIProgressView.appearance().trackTintColor
- trackColorUIProgressView.appearance().progressImage
- progressImageUIProgressView.appearance().trackImage
- trackImageUIProgressView.appearance().progressViewStyle
- progressViewStyleUISegmentedControl
UISegmentedControl.appearance().tintColor
- tintColorUISlider
UISlider.appearance().minimumTrackTintColor
- minimumTrackTintColorUISlider.appearance().thumbTintColor
- thumbTintColorUISlider.appearance().maximumTrackTintColor
- maximumTrackTintColorUISlider.appearance().minimumValueImage
- minimumValueImageUISlider.appearance().maximumValueImage
- 最大值图片UIStepper
UIStepper.appearance().tintColor
- 按钮颜色UISwitch
UISwitch.appearance().onTintColor
- 打开颜色UISwitch.appearance().thumbTintColor
- 滑块颜色UISwitch.appearance().onTintColor
- 按钮颜色UISwitch.appearance().onImage
- 打开图标UISwitch.appearance().offImage
- 关闭图标UITabBar
UITabBar.appearance().barTintColor
- 标签栏背景UITabBar.appearance().tintColor
- 项目条目颜色UITabBar.appearance().barStyle
- 标签栏样式UITabBar.appearance().translucent
- 透明度UIToolbar
UIToolbar.appearance().barTintColor
- 工具栏背景UIToolbar.appearance().tintColor
- 项目条目颜色UIToolbar.appearance().barStyle
- 工具栏样式UIToolbar.appearance().translucent
- 透明度HaidoraThemeKit 基于 MIT 许可。有关更多信息,请参阅 LICENSE 文件。