From 9f19716bc74c3fd9191d11e419537b696c683a28 Mon Sep 17 00:00:00 2001 From: alin23 Date: Tue, 26 Jul 2016 17:26:45 +0300 Subject: [PATCH] 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. --- React/Views/RCTPicker.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/React/Views/RCTPicker.m b/React/Views/RCTPicker.m index d29dd2e414c488..b9ac79387bd42b 100644 --- a/React/Views/RCTPicker.m +++ b/React/Views/RCTPicker.m @@ -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