[翻译] MAThemeKit

简介:

MAThemeKit

https://github.com/mamaral/MAThemeKit

 

MAThemeKit provides iOS developers the ability to create a coherent color theme throughout their entire application using a single line of code, removing the need to mess with the dozens of UIAppearance proxies for each UI component.

MAThemeKit给开发者提供一个方法,来产生一个前后一致的主题风格,贯穿整个应用,仅仅通过一行代码,你再也不用那恶心的,一系列繁琐的设置了。

Usage

Drop the MAThemeKit.h/m files into your project, import the header into your AppDelegate.m file, and in the application:didFinishLaunchingWithOptions: method tell MAThemeKit what you'd like your primary and secondary theme colors to be, what you want for a font for your applications Navigation/TabBar's and if you'd like the status bar to be light or not. (NOTE - you'll still need to manually add the 'View controller-based status bar appearance' key to your Info.plist and set it to NO for the status bar to be set to light content.)

将文件MAThemeKit.h、MAThemeKit.m拖到你的工程当中,在AppDelegate.m文件中引入头文件,然后在application:didFinishLaunchingWithOptions:方法中,让MAThemeKit知道你的设置。(注意-你需要手动在plist文件中添加选项将View controller-based status bar appearance设置成NO)

In one simple line of code, your entire application will be set to your new beautiful theme!

仅仅一行代码,你的整个应用程序都会被设置成一个漂亮的主题!

[MAThemeKit setupThemeWithPrimaryColor:[MAThemeKit colorWithR:0 G:184 B:156] secondaryColor:[UIColor whiteColor] fontName:@"HelveticaNeue-Light" lightStatusBar:YES];

There are two convenience methods provided by MAThemeKit to create UIColor objects from the RGB values or hex strings, for quick and easy creation of color information you might get from photoshop's color picker.

以下有两个方法提供给你,用于便利的获取颜色。

// Use the rgb values BEFORE they are divided by 255.0, like you would see in photoshop's color picker
UIColor *colorWithRGB = [MAThemeKit colorWithR:0 G:184 B:156] // Use the normal hex string representing the color UIColor *colorWithHex = [MAThemeKit colorWithHexString:@"00b89c"];

 看源码:

 

目录
相关文章
|
7月前
|
并行计算 算法 程序员
FreeLearning C/C++ 译文集翻译完成
FreeLearning C/C++ 译文集翻译完成
31 1
|
存储 自然语言处理 前端开发
从零写一个Recoil(翻译)
Rewriting Recoil from scratchrecoil是facebook编写的一个库,它之所以诞生是因为人体工程学、context的性能问题和useState。这是一个非常聪明的库,几乎每个人都会找到它的用途——如果你想了解更多,请查看这段解释视频。刚开始我被图论和recoil惊到了,但渐渐的理解后,感觉也没那么特别了。也许我也可以实现一个类似的东西。我自己实现的版本和recoil
238 0
从零写一个Recoil(翻译)
|
XML Java Android开发
[翻译]IAdaptable是什么?
IAdaptable在Eclipse里是一个非常重要的接口。对于Eclipse开发老手来说,它就像异常处理和抽象类一样寻常;但是对新手而言,它却令人感到困惑和畏惧。这篇文章将向你解释IAdaptable到底是什么,以及它在Eclipse里起到的作用。
1213 0
|
安全 开发工具 C#
|
Java iOS开发 Spring
下一篇
DataWorks