问题
numberPicker1= (NumberPicker) findViewById(R.id.numberPicker1);
final String genders[] = { "red", "blue", "green"};
numberPicker1.setMinValue(0);
numberPicker1.setMaxValue(genders.length - 1);
numberPicker1.setDisplayedValues(genders);
numberPicker1.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);;
NumberPicker.OnValueChangeListener myValChangedListener = new NumberPicker.OnValueChangeListener() {
@Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
Toast.makeText(MainActivity.this,
"Value: " + genders[newVal], Toast.LENGTH_LONG).show();
}
};
it disply random picker how to hide previous one and next one value/string?
回答1:
Unfortunately I find out there is no way to do it so... For them who want alternate solution.... I applied Viewpager instead of number picker to make it vertical i tried link and applied Onpagechangelistner. Simply done...
Sorry for those who are looking for solve issue For Numbericker!!
来源:https://stackoverflow.com/questions/43004336/android-picker-hide-upper-and-lower-value