可配置 UI Style 工具库 StyleKit

码农软件 · 软件分类 · CSS框架 · 2019-04-20 13:29:31

软件介绍

StyleKit 是能让你使用一个简单的 JSON 文件美化你的应用的微框架。

它如何工作?

按如下格式创建一个 JSON 文件:

{
    "UILabel": {
        "font": "HelveticaNeue-Bold:30.0",
        "backgroundColor": "#000FFF"
    },
    "StyleKitDemo.SKView": {
        "StyleKitDemo.SKLabel": {
            "font": "HelveticaNeue-Bold:20.0",
            "backgroundColor": "#FFF000",
            "color": "#fff"
        },
        "StyleKitDemo.SKButton": {
            "font": "HelveticaNeue-Light:20.0",
            "titleColor:normal": "#FFFFFF",
            "titleColor:highlighted": "#000000"
        }
    },
    "StyleKitDemo.SKNavigationBar": {
        "titleTextAttributes": {
            "NSColor": "#000FFF",
            "NSFont": "HelveticaNeue-Bold:30.0"
        }
    },
    "StyleKitDemo.SKTextField": {
        "font": "HelveticaNeue-Light:20.0",
        "textColor": "#000FFF"
    }
}

加载 JSON 文件

func application(application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    if let styleFile = NSBundle.mainBundle().URLForResource("style", withExtension: "json") {
        StyleKit(fileUrl: styleFile)?.apply()
    }
    return true
}

安装:

Carthage

github "146BC/StyleKit" ~> 0.3

CocoaPods

Add the 146BC Source

source 'https://github.com/146BC/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
pod 'StyleKit', '~> 0.3

本文地址:https://codercto.com/soft/d/3994.html

Discrete Mathematics and Its Applications

Discrete Mathematics and Its Applications

Kenneth H Rosen / McGraw-Hill Science/Engineering/Math / 2003-04-22 / USD 132.81

Discrete Mathematics and its Applications is a focused introduction to the primary themes in a discrete mathematics course, as introduced through extensive applications, expansive discussion, and deta......一起来看看 《Discrete Mathematics and Its Applications》 这本书的介绍吧!

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具