开发者

How can i customize UIDatePicker for Hijri

How can i customize U开发者_如何学CIDatePicker for Hijri? Like this

How can i customize UIDatePicker for Hijri


In your ViewController, adopt the UIPickerViewDelegate protocol, and add a UIPickerView to the view, setting its delegate and datasource to self.

Override the pickerView:widthForComponent: method from UIPickerViewDelegate to have a custom width for each component (a component is a "column", so here you have three)

Override the numberOfComponentsInPickerView: from the UIPickerViewDataSource protocol an return 3

To populate your picker, use pickerView:titleForRow:forComponent: from UIPickerViewDelegate and numberOfComponentsInPickerView: from UIPickerViewDataSource

For a cleaner and more reusable code, I'll just subclass UIPickerView

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜