So I have a uipickerview with rows that only contain the number 0-24 and it looks a bit silly since the numbers are left aligned leaving a huge gap on the right of the picke
Below one also working fine -
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [pickerView rowSizeForComponent:component].width, [pickerView rowSizeForComponent:component].height)];
lbl.text = [reservePickerArray objectAtIndex:row];
lbl.adjustsFontSizeToFitWidth = YES;
lbl.textAlignment=UITextAlignmentCenter;
lbl.font=[UIFont systemFontOfSize:20];
return lbl;
}
Cheers!!