UIKit appearance 的封装。
To run the example project, clone the repo, and run pod install
from the Example directory first.
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)
HaidoraThemeKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "HaidoraThemeKit"
可以通过CocoaSeeds来安装。Seedfile如下:
github "Haidora/HaidoraThemeKit", "0.1.0", :files => "Pod/Classes/*.{swift,h}"
Download the latest tag and drag the sources into your Xcode project.
UIActivityIndicatorView
UIActivityIndicatorView.appearance().activityIndicatorViewStyle
- activityIndicatorViewStyle UIActivityIndicatorView.appearance().color
- activityColor UINavigationBar
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
- maximumTrackTintColor UISlider.appearance().minimumValueImage
- minimumValueImageUISlider.appearance().maximumValueImage
- maximumValueImageUIStepper
UIStepper.appearance().tintColor
- tintColorUISwitch
UISwitch.appearance().onTintColor
- turnedOnColor UISwitch.appearance().thumbTintColor
- thumbTintColor UISwitch.appearance().onTintColor
- tintColor UISwitch.appearance().onImage
- onImageUISwitch.appearance().offImage
- offImageUITabBar
UITabBar.appearance().barTintColor
- tabbarBackground UITabBar.appearance().tintColor
- barItemTintColorUITabBar.appearance().barStyle
- barStyleUITabBar.appearance().translucent
- translucentUIToolbar
UIToolbar.appearance().barTintColor
- toolbarBackground UIToolbar.appearance().tintColor
- barItemTintColorUIToolbar.appearance().barStyle
- barStyleUIToolbar.appearance().translucent
- translucentHaidoraThemeKit is available under the MIT license. See the LICENSE file for more info.