Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

item start position #226

Closed
kainjinez opened this issue Mar 28, 2017 · 6 comments
Closed

item start position #226

kainjinez opened this issue Mar 28, 2017 · 6 comments

Comments

@kainjinez
Copy link

OptionsPickerView keeps last scroll, even they scroll but hide it instead of select, position for next showing. How to prevent it? I want OPV always start at picked position. How to do that? I find in the source code but didnt found anything.

@xiaosong520
Copy link
Member

@kainjinez Hi~ do you mean that you need to set the selected item? please add the following code: pvOptions.setSelectOptions(0,1,2)

@kainjinez
Copy link
Author

kainjinez commented Mar 28, 2017

Hi. Let me clear this.
I have 10 items in list. I scroll to position 4 then click OK.
After that, I open wheel again, It started at position 4 i scroll to postion 6. But cancel.
Next time I open the wheel, It started at position 6.
All I want to do is: every next time i open the wheel, it will start at last selected position (for this example is position 4).

@xiaosong520
Copy link
Member

@kainjinez That is all right, you need save the selected positions after click OK( in onOptionsSelect method ), and then ,before you open OptionsPickerView , add the following code : pvOptions.setSelectOptions(options1, option2, options3) .

@kainjinez
Copy link
Author

I'll check it and reply soon. Thanks alot anyway.

@xiaosong520
Copy link
Member

@kyuyi You are welcome

@kainjinez
Copy link
Author

It doesn't work for me. I have to edit a bit code to override setOnDismissListener. Then i setSeectOptions. After that, i have to setPicker again. Then now it works. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants