UIFont
has the fontSize property. You can make use of that.
titleCustomLabel.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline].pointSize];
(don't use fontSize at the end)
题
While using Interface builder & iOS7 UIFontTextStyleHeadline I set my headline label to UIFontTextStyleHeadline
(I guess it can be done also with the following code:)
myHeadlineTextLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
Q: this works well, yet I would like to have the same functionality only using HelveticaNeue-Thin
just as an example:
titleCustomLabel.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:(**Dynamic font size as the user defined in his setting**)];
what would be an elegant way to do so?
解决方案
UIFont
has the fontSize property. You can make use of that.
titleCustomLabel.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline].pointSize];
(don't use fontSize at the end)