Skip to content

Commit 9f19716

Browse files
committed
Adjust row height by font size in PickerIOS
There is a problem where setting a bigger fontSize in PickerItem style clips the top and bottom of the text. This solves that problem by computing the row height using the font size.
1 parent 6b6d269 commit 9f19716

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

React/Views/RCTPicker.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ - (NSString *)pickerView:(__unused UIPickerView *)pickerView
7070
return [RCTConvert NSString:_items[row][@"label"]];
7171
}
7272

73+
- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component {
74+
return _font.pointSize + 19;
75+
}
76+
7377
- (UIView *)pickerView:(UIPickerView *)pickerView
7478
viewForRow:(NSInteger)row
7579
forComponent:(NSInteger)component

0 commit comments

Comments
 (0)