Skip to content

Commit 3287d67

Browse files
authored
fix: ios: Not selected tab gets bold face when setting fontSize #80
1 parent d9c0822 commit 3287d67

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ios/RNCSegmentedControl.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ - (void)setSelectedIndex:(NSInteger)selectedIndex
4141

4242
- (void)setFontSize:(NSInteger)fontSize
4343
{
44-
UIFont *font = [UIFont boldSystemFontOfSize: fontSize];
44+
UIFont *font = [UIFont systemFontOfSize: fontSize];
4545
[_attributes setObject: font forKey:NSFontAttributeName];
4646
[self setTitleTextAttributes:_attributes
4747
forState:UIControlStateNormal];
48+
UIFont *fontBold = [UIFont boldSystemFontOfSize: fontSize];
49+
[_attributes setObject: fontBold forKey:NSFontAttributeName];
50+
[self setTitleTextAttributes:_attributes
51+
forState:UIControlStateSelected];
4852
}
4953

5054
- (void)setBackgroundColor:(UIColor *)backgroundColor

0 commit comments

Comments
 (0)