开发者

How to get the number of items in a spinner?

开发者 https://www.devze.com 2023-04-06 06:58 出处:网络
How to get the number of 开发者_运维技巧items in a spinner dynamically?You can try: mSpinner.getAdapter().getCount();

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

精彩评论

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