0

I want to change the picker view bakground color. I try this way but not worked.

doublePicker.backgroundColor = [self RGBColorR:85 G:17 B:92];
- (UIColor *)RGBColorR:(double)red G:(double)green B:(double)blue {

return [UIColor colorWithRed:(red/255.00) green:(green/255.00) blue:(blue/255.00) alpha:1.00];

}

I want to do picker view like in picture. How can I do this? Thanks for your reply.enter image description here

Hacer Akac
  • 175
  • 1
  • 7
  • 18
  • My [answer](http://stackoverflow.com/a/10432840/1346231) to a [similar question](http://stackoverflow.com/questions/965375/change-uipickerview-background) must be helpful. It shows how to do exactly what you want. – Leon Deriglazov May 03 '12 at 14:01
  • Have you solved this problem ?? I am trying to do the same way. Please help me out – Perseus Jul 31 '12 at 22:54

2 Answers2

1

you can add subviews over certain areas of your pickerview..

use:

 [picker addSubview: coverView];  //adding subviews to different area of the picker

you're going to find yourself playing with alot of CGRect to get thing to fit properly. If you want to change the entire thing you're going to have to override some methods that handle the touch events etc..

this tutorial might help you create a custom picker

https://developer.apple.com/iphone/library/samplecode/UICatalog/

DJPlayer
  • 3,244
  • 2
  • 33
  • 40
0

You cannot change the appearance of UIPickerView, even the size, it's the most unchangeable UI element in iOS. Best you can do is build custom by yourself, using UIScrollView with paging enabled.

Kyr Dunenkoff
  • 8,090
  • 3
  • 23
  • 21
  • How can I do this? Can you give me an example or can you explain the UIScrollView with paging enabled? – Hacer Akac Feb 03 '12 at 14:35
  • Is this like this? http://www.iosdevnotes.com/2011/03/uiscrollview-paging/ If yes, I dont wanna like paging. Is there any other way to do picker view. – Hacer Akac Feb 03 '12 at 14:39