I have created a sample picker-view which will display some details. Setting the Background color using:
_pickerView.backgroundColor = [UIColor redColor];
doesn't seems to be working . But I wish I could create a picker view like the below image
What I was trying to do is , the entire PickerView background color should not be white, it should fill with the UIColor
which I am giving. Is that possible?? How it can be done ??
An easy to use and customizable view component that presents a UIPickerView with a toolbar, Done button, animation, design options, selected value and previously selected value functionality. Works with iOS 6 and even better in iOS 7, because it let's you change the background color of the PickerView. Images to the left: iOS 6.
You can change many attributes of a string. You cannot change the font in attributed text for picker views. There is one more very powerful method for displaying something on a UIPickerView. There is a method in the delegate to display a UIView. One subclass of UIView is a UILabel.
How To Set Customize Color As Rectangle UIView Background. Create an instance of UIKit.UIColor class, pass the color RGB (red, green, blue) value and color opacity (alpha) value to the UIColor class’s initializer. You can refer UIKit.UIColor initializer document .
Create an instance of UIKit.UIColor class, pass the color RGB (red, green, blue) value and color opacity (alpha) value to the UIColor class’s initializer. You can refer UIKit.UIColor initializer document . Now set above customized UIColor object variable as the rectangle view’s background color.
Addition to Nina's answer, below are some of the good custom Picker view controls which will be good to use in terms of performance and customizable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With