為你的iOS應用添加夜間模式的框架:DKNightVersion

n6bg 9年前發布 | 37K 次閱讀 iOS開發 移動開發 DKNightVersion

DKNightVersion是一個輕量級的框架能夠為你的iOS應用添加夜間模式。這個框架的很多代碼都是由Ruby腳本生成。

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like DKNightVersion in your projects. See the Get Started section for more details.

Podfile

pod "DKNightVersion", "~> 0.4.5"

Usage

#import "DKNightVersion.h"

How to use

API documentation is not available now.

Using night color

This framework is based on a propertynightColor, such asnightBackgroundColornightTextColor...

Assign the night version color you want to theUIKitcomponent:

self.view.nightBackgroundColor = [UIColor blackColor];
self.label.nightTextColor = [UIColor whiteColor];

Using DKNightVersionManager change theme

UseDKNightVersionManagersets the theme.

[DKNightVersionManager nightFalling];

If you'd like to switch back to normal theme version:

[DKNightVersionManager dawnComing];

項目主頁:http://www.baiduhome.net/lib/view/home/1430375382974

 本文由用戶 n6bg 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!