Skip to content

Commit

Permalink
UI样式进一步与UIAlertController靠近
Browse files Browse the repository at this point in the history
  • Loading branch information
Gdxy committed Apr 16, 2020
1 parent 9cb69fd commit 4677e75
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions TLAlertController/TLAlertLib/TLAlertController.m
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,9 @@ - (void)initProperties {
self.effectStyle = UIBlurEffectStyleExtraLight;
}

NSString *titleColor = _preferredStyle == TLAlertControllerStyleAlert ? @"#101010" : @"#878889";
NSString *msgeColor = _preferredStyle == TLAlertControllerStyleAlert ? @"#181818" : @"#959698";
BOOL isAlert = _preferredStyle == TLAlertControllerStyleAlert;
NSString *titleColor = isAlert ? @"#101010" : @"#878889";
NSString *msgeColor = isAlert ? @"#181818" : @"#959698";

self.separatorColor = [TLAlertController colorWithHex:isDarkMode ? @"#999" : @"#AAA"];
self.titleColor = [TLAlertController colorWithHex:isDarkMode ? @"#FFF" : titleColor];
Expand All @@ -532,19 +533,19 @@ - (void)initProperties {
self.textColorOfCancel = [TLAlertController colorWithHex:@"#097FFF"];
self.textColorOfDestructive = [TLAlertController colorWithHex:@"#FF4238"];

self.titleFont = [UIFont boldSystemFontOfSize:13];
self.titleFont = [UIFont systemFontOfSize:(isAlert ? 17 : 13) weight:UIFontWeightSemibold];
self.messageFont = [UIFont systemFontOfSize:13];
self.textFontOfDefault = [UIFont systemFontOfSize:17];
self.textFontOfCancel = [UIFont boldSystemFontOfSize:17];
self.textFontOfCancel = [UIFont systemFontOfSize:17 weight:isAlert ? UIFontWeightRegular : UIFontWeightSemibold];
self.textFontOfDestructive = [UIFont systemFontOfSize:17];

self.actionBgColorOfHighlighted = [UIColor colorWithWhite:0 alpha:isDarkMode ? 0.13 : 0.04];
self.backgroundColorOfCancelView = [TLAlertController colorWithHex:isDarkMode ? @"#2C2C2E" : @"#FFF"];;

self.btns = [NSMutableDictionary dictionary];

self.rowHeight = _preferredStyle == TLAlertControllerStyleAlert ? kAlertRowHeight : kRowHeight;
self.separatorLineHeight = _preferredStyle == TLAlertControllerStyleAlert ? kAlertSeparatorLineHeight : kSeparatorLineHeight;
self.rowHeight = isAlert ? kAlertRowHeight : kRowHeight;
self.separatorLineHeight = isAlert ? kAlertSeparatorLineHeight : kSeparatorLineHeight;

self.cornerRadius = kCornerRadius;
self.margin = kMargin;
Expand Down

0 comments on commit 4677e75

Please sign in to comment.