I want to change the background color in UIPickerView
, Is it possible?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
UPDATE: One simple trick is to set the alpha on some of the subviews. Which one specifically depends on how many components you have, but the code is:
This will make the dial semi transparent and show through the background colour.
Setting the backgroudColor doesn't appear to do anything. The best I have been able to do so far is set the background colour of individual component rows, which is next to useless as the base colour of the component will remain white.
Ideally I'd like to set the background colour of an each component (i.e. dial).
On iOS 7 I just drop a custom background image behind it. Didn't have to change anything else.
Finally managed to do it. I try it for a picker view with one component.
set the picker view background color to clear color by wizard or by code as follow:
Set alpha value to 0.0f for the picker view subviews numbered 0, 1 and 3. (Don't know why there is subview 2 thought). Do it by code after the first load data for the picker view as follow (it will throw an exception if you do this in the DidViewLoad).
Don't forget to clear background color for the label you are sending to the picker view in the viewForRow method.
Seems iOS 4.2 doesn't has any subview...
returns empty array.