ELAlertView
ELAlertView 可以定制化彈框的外形和其內(nèi)容搬瑰,最關(guān)鍵的是可以放置圖片. 你可以使用它來代替系統(tǒng)的UIAlertController/UIAlertView.
支持iOS7.
This project is inspired by NYAlertViewController
Gif圖還是去github上看吧https://github.com/rainer-liao/ELAlertView .
Installation 安裝
Manual 手動
下載本項目,將項目中的ELAlertView文件拖到你的Xcode工程就OK了.
CocoaPods
pod 'ELAlertView', '~>1.0.0'
How To Use 使用方法
// Import the class
#import "ELAlertView.h"
// ...
// Create an instance
ELAlertView *alertView = [[ELAlertView alloc] initWithStyle:ELAlertViewStyleDefault];
// Set title and message if needed
alertView.title = @"title";
alertView.message = @"message";
// Custom your appearance
alertView.titleTopMargin = 17;
alertView.messageLeadingAndTrailingPadding = 20;
alertView.messageAlignment = NSTextAlignmentLeft;
alertView.messageHeight = 270;
alertView.alertViewBackgroundColor = [UIColor redColor];
alertView.titleColor = [UIColor blueColor];
alertView.messageColor =[UIColor purpleColor];
alertView.buttonBottomMargin = 30;
// Add alert actions
ELAlertAction *action = [ELAlertAction actionWithTitle:NSLocalizedString(@"ok", nil)
style:ELAlertActionStyleDestructive
handler:^(ELAlertAction *action) {
}];
[alertView addAction:action];
// Show the alertView
[alertView show];
License
This project is released under the MIT License.
一些碎語
約束是用系統(tǒng)自帶的那套寫的款票,非常惡心,還用了VTL. 想了解的同學可以去看看這篇文章http://xuexuefeng.com/autolayout/.
如果想要更多的定制化, 應(yīng)該還是還有些事情可以做的. 一般情況下, 目前夠用了.
如果有哪些不對的地方, 請多多指教.
如果覺得對你有幫助, 求幫star一下~
下班, 回家!