How to get the number of items in a spinner?

戏子无情 提交于 2019-12-21 06:49:24

问题


How to get the number of items in a spinner dynamically?


回答1:


You can try:

mSpinner.getAdapter().getCount();



回答2:


spinerObj.getAdapter.getCount();

for getting number of item




回答3:


spinnerAdapter.getCount(); or spinnerList.size();



来源:https://stackoverflow.com/questions/7467326/how-to-get-the-number-of-items-in-a-spinner

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!