highlight button status
This commit is contained in:
parent
e46ace462a
commit
c5e306f0ae
@ -328,7 +328,18 @@
|
|||||||
if (self.skipHighlighted) {
|
if (self.skipHighlighted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (self.primaryButtonType == PrimaryButtonTypeRed) {
|
if (self.primaryButtonType == PrimaryButtonTypeCustom) {
|
||||||
|
if (highlighted && self.enabled) {
|
||||||
|
CALayer *mask = [[CALayer alloc] init];
|
||||||
|
mask.backgroundColor = [UIColor whiteColor].CGColor;
|
||||||
|
mask.opacity = 0.7;
|
||||||
|
mask.frame = self.bounds;
|
||||||
|
self.layer.mask = mask;
|
||||||
|
self.layer.opaque = true;
|
||||||
|
} else if (!highlighted) {
|
||||||
|
self.layer.mask = nil;
|
||||||
|
}
|
||||||
|
} if (self.primaryButtonType == PrimaryButtonTypeRed) {
|
||||||
if (self.bordered) {
|
if (self.bordered) {
|
||||||
if (highlighted) {
|
if (highlighted) {
|
||||||
self.backgroundColor = [UIColor mfRedColor];
|
self.backgroundColor = [UIColor mfRedColor];
|
||||||
@ -485,11 +496,12 @@
|
|||||||
[self setTitleColor:(self.disabledTextColor ?: [UIColor blackColor]) forState:UIControlStateNormal];
|
[self setTitleColor:(self.disabledTextColor ?: [UIColor blackColor]) forState:UIControlStateNormal];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[self setTitleColor:[self titleColorForState:UIControlStateNormal] forState:UIControlStateHighlighted];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setBordered:(BOOL)bordered {
|
- (void)setBordered:(BOOL)bordered {
|
||||||
if (bordered != _bordered) {
|
if (bordered != _bordered) {
|
||||||
if (self.buttonType == PrimaryButtonTypeCustom) {
|
if (self.primaryButtonType == PrimaryButtonTypeCustom) {
|
||||||
_bordered = bordered;
|
_bordered = bordered;
|
||||||
[self setAsCustom];
|
[self setAsCustom];
|
||||||
} else if (bordered) {
|
} else if (bordered) {
|
||||||
|
|||||||
@ -12,11 +12,9 @@
|
|||||||
|
|
||||||
#pragma mark - 2.0
|
#pragma mark - 2.0
|
||||||
|
|
||||||
+ (nonnull UIColor *)mfNegativeOrangeColor;
|
|
||||||
+ (nonnull UIColor *)mfSwitchOnTintColor;
|
+ (nonnull UIColor *)mfSwitchOnTintColor;
|
||||||
+ (nonnull UIColor *)mfSwitchOffTintColor;
|
+ (nonnull UIColor *)mfSwitchOffTintColor;
|
||||||
+ (nonnull UIColor *)mfSilver;
|
+ (nonnull UIColor *)mfSilver;
|
||||||
+ (nonnull UIColor *)mfSilverTwo;
|
|
||||||
+ (nonnull UIColor *)mfBattleshipGrey;
|
+ (nonnull UIColor *)mfBattleshipGrey;
|
||||||
+ (nonnull UIColor *)mfPrimaryButtonHighlightBlackColor;
|
+ (nonnull UIColor *)mfPrimaryButtonHighlightBlackColor;
|
||||||
+ (nonnull UIColor *)mfPrimaryWhiteButtonDisableColor;
|
+ (nonnull UIColor *)mfPrimaryWhiteButtonDisableColor;
|
||||||
@ -26,7 +24,6 @@
|
|||||||
+ (nonnull UIColor *)mfPumpkinColor;
|
+ (nonnull UIColor *)mfPumpkinColor;
|
||||||
+ (nonnull UIColor *)mfShamrock;
|
+ (nonnull UIColor *)mfShamrock;
|
||||||
+ (nonnull UIColor *)mfCerulean;
|
+ (nonnull UIColor *)mfCerulean;
|
||||||
+ (nonnull UIColor *)mfLightBlackColor;
|
|
||||||
+ (nonnull UIColor *)mfWhiteTwo;
|
+ (nonnull UIColor *)mfWhiteTwo;
|
||||||
|
|
||||||
#pragma mark - legacy
|
#pragma mark - legacy
|
||||||
|
|||||||
@ -13,10 +13,6 @@
|
|||||||
|
|
||||||
#pragma mark - 2.0
|
#pragma mark - 2.0
|
||||||
|
|
||||||
+ (nonnull UIColor *)mfNegativeOrangeColor {
|
|
||||||
return [UIColor mfPumpkinColor];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UIColor *)mfSwitchOnTintColor {
|
+ (nonnull UIColor *)mfSwitchOnTintColor {
|
||||||
return [UIColor mfShamrock];
|
return [UIColor mfShamrock];
|
||||||
}
|
}
|
||||||
@ -29,10 +25,6 @@
|
|||||||
return [UIColor mfColor8bitsWithRed:216 green:218 blue:218 alpha:1.0];
|
return [UIColor mfColor8bitsWithRed:216 green:218 blue:218 alpha:1.0];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull UIColor *)mfSilverTwo {
|
|
||||||
return [UIColor mfColor8bitsWithRed:217 green:219 blue:219 alpha:1.0];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UIColor *)mfBattleshipGrey {
|
+ (nonnull UIColor *)mfBattleshipGrey {
|
||||||
return [UIColor mfColor8bitsWithRed:116 green:118 blue:118 alpha:1.0];
|
return [UIColor mfColor8bitsWithRed:116 green:118 blue:118 alpha:1.0];
|
||||||
}
|
}
|
||||||
@ -70,10 +62,6 @@
|
|||||||
return [UIColor mfColor8bitsWithRed:0 green:122 blue:184 alpha:1.0];
|
return [UIColor mfColor8bitsWithRed:0 green:122 blue:184 alpha:1.0];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull UIColor *)mfLightBlackColor {
|
|
||||||
return [UIColor mfColor8bitsWithRed:95 green:95 blue:95 alpha:1.0];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (nonnull UIColor *)mfWhiteTwo {
|
+ (nonnull UIColor *)mfWhiteTwo {
|
||||||
return [UIColor mfColor8bitsWithRed:246 green:246 blue:246 alpha:1.0];
|
return [UIColor mfColor8bitsWithRed:246 green:246 blue:246 alpha:1.0];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user