mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
Better way to adjust size
This commit is contained in:
parent
7170d2681f
commit
4789166a33
1 changed files with 6 additions and 13 deletions
19
Tweak.xm
19
Tweak.xm
|
|
@ -20,21 +20,14 @@ static inline NSString *LOC(NSString *key) {
|
|||
return [tweakBundle localizedStringForKey:key value:nil table:nil];
|
||||
}
|
||||
|
||||
@interface PKYStepper : UIControl
|
||||
@end
|
||||
|
||||
// Fit speed controllers localized 'Normal' text into frame
|
||||
%hook PKYStepper
|
||||
- (void)layoutSubviews {
|
||||
%orig;
|
||||
|
||||
for (UIView *subview in self.subviews) {
|
||||
if ([subview isKindOfClass:[UILabel class]]) {
|
||||
UILabel *label = (UILabel *)subview;
|
||||
label.adjustsFontSizeToFitWidth = YES;
|
||||
label.minimumScaleFactor = 0.5;
|
||||
}
|
||||
}
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = %orig;
|
||||
if (self) {
|
||||
UILabel *countLabel = [self valueForKey:@"countLabel"];
|
||||
countLabel.adjustsFontSizeToFitWidth = YES;
|
||||
} return self;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue