How to get the number of items in a spinner?

2019-04-03 05:29发布

问题:

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();