Device battery indicators on your Lock Screen
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

34 行
1.1KB

  1. #import "KAIStackView.h"
  2. @implementation KAIStackView
  3. -(id)initWithFrame:(CGRect)arg1 {
  4. self = [super initWithFrame:arg1];
  5. self.translatesAutoresizingMaskIntoConstraints = NO;
  6. return self;
  7. }
  8. -(void)addSubview:(UIView *)view {
  9. [super addSubview:view];
  10. [(UIScrollView *)self.superview.superview setContentSize:self.frame.size];
  11. if(textColor==0 && [view respondsToSelector:@selector(updateInfo)]) {
  12. KAIBatteryCell *cell = (KAIBatteryCell *)view;
  13. if(@available(iOS 12.0, *)) {
  14. if(self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
  15. [cell.label setTextColor:[UIColor whiteColor]];
  16. [cell.percentLabel setTextColor:[UIColor whiteColor]];
  17. } else if(self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleLight) {
  18. [cell.label setTextColor:[UIColor blackColor]];
  19. [cell.percentLabel setTextColor:[UIColor blackColor]];
  20. }
  21. }
  22. }
  23. }
  24. -(void)layoutSubviews {
  25. [super layoutSubviews];
  26. [(KAIBatteryPlatter *)(self.superview.superview) calculateHeight];
  27. }
  28. @end