Reputation: 4517
Do you know how to add static caption to the watchOS picker? The caption looks like this and it says Item 1.
I already selected appropriate style in the Interface Builder:
My code:
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
let item1 = WKPickerItem()
item1.title = "10"
let item2 = WKPickerItem()
item2.title = "20"
let item3 = WKPickerItem()
item3.title = "30"
picker.setItems([item1, item2, item3])
picker.focus()
}
Result I got in the Simulator:
How to add missing caption on top of the picker?
Upvotes: 3
Views: 724
Reputation: 3513
You should provide a caption to each WKPickerItem
:
let item1 = WKPickerItem()
item1.title = "10"
item1.caption = "CAPTION!"
Upvotes: 4