开发者

How to get the number of items in a spinner?

How to get the number of 开发者_运维技巧items in a spinner dynamically?


You can try:

mSpinner.getAdapter().getCount();


spinerObj.getAdapter.getCount();

for getting number of item


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


In Kotlin:

val spinnerCtr = binding.spinnerName.count

produces the number of list items. It starts at zero.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜