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

Change height/width #57

Closed
vados60 opened this issue May 3, 2017 · 5 comments
Closed

Change height/width #57

vados60 opened this issue May 3, 2017 · 5 comments
Labels
bug Indicates an unexpected problem or unintended behavior.

Comments

@vados60
Copy link

vados60 commented May 3, 2017

Hello!

Is there any chance to set number of currently visible rows except selected one?
Or is there any chance to hide all other rows except selected?

if I set
app:np_wheelItemCount="1"

when try to scroll the app crashes with IndexOutOfBounds exception
java.lang.ArrayIndexOutOfBoundsException: length=1; index=-1
at com.shawnlin.numberpicker.NumberPicker.incrementSelectorIndices(NumberPicker.java:1695)

WBR
Vadim

@scastro
Copy link

scastro commented May 4, 2017

I have the same issue.

Also, the control uses the space above and below as if would have more items to show.

@ShawnLin013 ShawnLin013 added the bug Indicates an unexpected problem or unintended behavior. label Jun 12, 2017
@ShawnLin013
Copy link
Owner

Hi @vados60,
Have you tried setting the text color to transparent?
numberPicker.setTextColorResource(android.R.color.transparent);
or
app:np_textColor="@android:color/transparent"

And no need to set the wheel item count to 1.

@duetdroid
Copy link

I met the same issue, and I think it is a bug.
I have checked the code. When app:np_wheelItemCount is set as 1, the size of selectorIndices will be 0(line 2113), then the IndexOutOfBound will happen in line 1775.

@soshial
Copy link

soshial commented Nov 17, 2017

I also have the same bug. A temporary kludge proposed by @ShawnLin013 works.

@ShawnLin013
Copy link
Owner

Supported at v2.4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior.
Projects
None yet
Development

No branches or pull requests

5 participants