user198725878
user198725878

Reputation: 6386

UIPickerView - Selection on Tap

I am showing a uipickerview , in that I set one entry as selected or highlighted.now when user want to have that already highlighted entry he has to scroll and select the entry. Instead is it possible to simply tap on a highlighted entry

For example I have options like below in the uipikcerview

================

- Land Promoters ( default highlighted )

So when, showing this picker, when jus tapping on the "Land Promoters", i want to be called this function

//===========================================================================
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row 
       inComponent:(NSInteger)component
//===========================================================================

Upvotes: 2

Views: 1319

Answers (1)

JOA80
JOA80

Reputation: 527

The best way to do this is to not use the didSelectRow callback. Instead put a done button, and on click of that button take the selectedRowInComponent of your picker view and hide the picker view. Now you can use the selectedRowInComponent to get the selected row and use that to fetch the name/etc from your data array.

Upvotes: 2

Related Questions