Skip to content

Commit

Permalink
Adjust row height by font size in PickerIOS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alin23 committed May 29, 2017
1 parent 6b6d269 commit 9f19716
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions React/Views/RCTPicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ - (NSString *)pickerView:(__unused UIPickerView *)pickerView
return [RCTConvert NSString:_items[row][@"label"]];
}

- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component {
return _font.pointSize + 19;
}

- (UIView *)pickerView:(UIPickerView *)pickerView
viewForRow:(NSInteger)row
forComponent:(NSInteger)component
Expand Down

0 comments on commit 9f19716

Please sign in to comment.