gpt4 book ai didi

java - Android ,我可以将 NumberPicker 更改为 CharPicker {A+,A,B+,B.C+,C,D+,D,F}

转载 作者:行者123 更新时间:2023-12-01 23:09:07 25 4
gpt4 key购买 nike

这是我的代码

np = (NumberPicker) findViewById(R.id.picker);
np.setMaxValue(9);
np.setValue(5);
np.setMinValue(1);

选择器可以查看 Char 吗?数量=查看

最佳答案

只需使用NumberPicker#setDisplayedValues()setMinValuesetMaxValue对应于数组索引:

NumberPicker np = (NumberPicker) findViewById(R.id.picker);
np.setMinValue(0);
np.setMaxValue(8);
np.setDisplayedValues(new String[] { "A+", "A", "B+", "B", "C+", "C", "D+", "D", "F"});

关于java - Android ,我可以将 NumberPicker 更改为 CharPicker {A+,A,B+,B.C+,C,D+,D,F},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22281271/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com