Answer the question
In order to leave comments, you need to log in
How does the font size change in devices?
Good day, I customize the program for all devices
. I have label elements and text on the buttons, let's say they look good at 4s, it will work on 5k, but what to do with 6 and 6+, because they will be small
. I have enlarged the elements, but the text on them remains the same size! For 6+ you can change (through size classes) and even then, only in the rotated state.
What to do ?! Is it really possible to have an outlet for each element and fix the sizes in viedDidLoad? (shit code)))
Maybe the same font size is the norm?
Answer the question
In order to leave comments, you need to log in
@interface AutoLabel ()
@property (nonatomic) CGFloat ff;
@property (nonatomic) BOOL isDone;
@end
@implementation AutoLabel
- (void)layoutSubviews {
[super layoutSubviews];
if (_isDone != true) {
_ff = self.font.pointSize;
_isDone = true;
}
CGSize sizee = [UIScreen mainScreen].bounds.size;
CGFloat ggH = sizee.height / 568.0;
self.font = [self.font fontWithSize:_ff*ggH];
}
@end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question