Skip to content

Instantly share code, notes, and snippets.

@Marlunes
Created July 4, 2013 06:30
Show Gist options
  • Save Marlunes/5925345 to your computer and use it in GitHub Desktop.
Save Marlunes/5925345 to your computer and use it in GitHub Desktop.
CUSTOMIZE PICKERVIEW TEXT/CONTENT
// Implement pickerview delegate
// Add some stuffs inside
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
UILabel *pickerLabel = (UILabel *)view;
CGRect frame = CGRectMake(0,0,250,40);
pickerLabel = [[UILabel alloc] initWithFrame:frame];
[pickerLabel setTextAlignment:UITextAlignmentCenter];
[pickerLabel setBackgroundColor:[UIColor clearColor]];
[pickerLabel setFont:[UIFont boldSystemFontOfSize:14.0]];
[pickerLabel setNumberOfLines:0];
[pickerLabel setText:[self.content objectAtIndex:row]];
return pickerLabel;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment