Customize UIPickerView's Skin with images

iphone, objective-c, uipickerview

Solution

I dont know this is a correct way or not but you can set your `UIPickerView` background image ... I have done it once.

See this :-

//Make a view to set as background of UIPickerView
UIView * viewForPickerView = [[UIView alloc]initWithFrame:CGRectMake(0.0, 0.0, 320.0, 216.0)];
[viewForPickerView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"pickerViewBackground.png"]]];

[[[pickerView subviews]objectAtIndex:2] addSubview: viewForPickerView];

//UIPickerView has 8 subviews like, background, rows, container etc.
// hide unnecessary subview

[(UIView*)[[pickerView subviews] objectAtIndex:3] setHidden:YES];
[(UIView*)[[pickerView subviews] objectAtIndex:5] setHidden:YES];
[(UIView*)[[pickerView subviews] objectAtIndex:6] setHidden:YES];
[(UIView*)[[pickerView subviews] objectAtIndex:7] setHidden:YES];
[(UIView*)[[pickerView subviews] objectAtIndex:8] setHidden:YES];

And now add a `UILabel` just on your `UIPickerView`'s `selectionIndicator`, and use `label` as a `selectionIndicator`. you can manage it in your own way.

Thank you!

Problem

I am developing an iPhone application. Where in, I want to have `UIPickerView` as in the image. Is it possible to change the appearance of `UIPickerView` like this?! Please guide me to do this!! I am creating it without XIB. Or is there a way to make `UIPickerView` skin transparent? Thanks in advance!! :-)

Original source

Related problems