This commit is contained in:
2025-10-28 20:11:40 +08:00
parent 935284388c
commit 13facba33a
3 changed files with 29 additions and 1 deletions

View File

@@ -26,11 +26,31 @@
self.layer.shadowOpacity = 1.0;
self.layer.shadowOffset = CGSizeMake(0, 1);
self.layer.shadowRadius = 1.5;
[self refreshStateAppearance];
}
- (void)setHighlighted:(BOOL)highlighted {
[super setHighlighted:highlighted];
self.alpha = highlighted ? 0.7 : 1.0; //
//
if (self.isSelected) {
self.alpha = 1.0;
} else {
self.alpha = highlighted ? 0.7 : 1.0;
}
}
- (void)setSelected:(BOOL)selected {
[super setSelected:selected];
[self refreshStateAppearance];
}
- (void)refreshStateAppearance {
// Shift/CapsLock
if (self.isSelected) {
self.backgroundColor = [UIColor colorWithWhite:0.85 alpha:1.0];
} else {
self.backgroundColor = [UIColor whiteColor];
}
}
@end