diff --git a/lib/ios/RNNTitleViewHelper.m b/lib/ios/RNNTitleViewHelper.m index ccbe8395aaf..33c5833a1d0 100644 --- a/lib/ios/RNNTitleViewHelper.m +++ b/lib/ios/RNNTitleViewHelper.m @@ -127,14 +127,10 @@ -(UILabel*)setupTitle { titleLabel.autoresizingMask = self.titleView.autoresizingMask; - UIFont *titleFont = [UIFont boldSystemFontOfSize:17.f]; + NSDictionary* fontAttributes = [RNNFontAttributesCreator createFontAttributesWithFontFamily:[_titleOptions.fontFamily getWithDefaultValue:nil] fontSize:[_titleOptions.fontSize getWithDefaultValue:nil] color:[_subtitleOptions.color getWithDefaultValue:nil]]; + [titleLabel setAttributedText:[[NSAttributedString alloc] initWithString:self.title attributes:fontAttributes]]; - CGFloat fontSizeFloat = [RCTConvert CGFloat:[_titleOptions.fontSize getWithDefaultValue:@(17)]]; - titleFont = [UIFont boldSystemFontOfSize:fontSizeFloat]; - - [titleLabel setAttributedText:[[NSAttributedString alloc] initWithString:self.title attributes:_titleOptions.fontAttributes]]; - - CGSize labelSize = [titleLabel.text sizeWithAttributes:@{NSFontAttributeName:titleFont}]; + CGSize labelSize = [titleLabel.text sizeWithAttributes:fontAttributes]; CGRect labelframe = titleLabel.frame; labelframe.size = labelSize; titleLabel.frame = labelframe;