JAK
JAK

Reputation: 6471

How to add separator line for each row in UIPickerView

I am using swift with xcode7.3.1.I would like to add separator lines for each row in UIPickerView.I would like to implement UIPickerview as the following screenshot

enter image description here

How to solve this issue.Please help me

Upvotes: 2

Views: 883

Answers (1)

Mehul Thakkar
Mehul Thakkar

Reputation: 12594

  1. Use -(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view method, instead of using titleForRow ..method

  2. Here create your custom view, with label and bottomline(UIView- as line) and return that view.

you will have required effect by this step.

Upvotes: 1

Related Questions