By default the first row is highlighted after initializing the UIPickerView. How do i highlight a particular row or scroll to particular row programmatically?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- 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
- Enum with associated value conforming to CaseItera
Yes, it's very easy
[picker selectRow:row inComponent:component animated:NO];
As always, this is thoroughly documented. The Apple documentation for
UIPickerView
should tell you that the method you probably want is– selectRow:inComponent:animated:
.If you want to trigger delegate's method pickerView:didSelectRow:inComponent, you should call it manually:
Obj-C
Swift