Android的微调如何显示下拉列表单选按钮 [英] How Android Spinner displays radio button in dropdown list
问题描述
我要编写自定义适配器,它能够显示自定义视图,我想,如果标准单选按钮在下拉列表中可见。我大致知道如何编写自定义适配器,但我不知道如何从标准的下拉列表视图preserve收音机这在微调是可见的:
=微调微调新(CTX);
ArrayAdapter< T>数据=新ArrayAdapter< T>(CTX,android.R.layout.simple_spinner_item,tclass.getEnumConstants());
data.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
如果最后一行被注释然后不使用的单选按钮。
我不知道,如果 simple_spinner_dropdown_item.xml
布局包含的TextView和单选按钮。
- 如何获取
simple_spinner_dropdown_item.xml
? - 如何单选按钮微调管理?那是在内部还是我需要实现它customadapter?
我一直在寻找在 ArrayAdapter
, SimpleAdapter
code,但也没有办法。<源/ p>
下面是定制微调的例子...
的http://easyandroidtutorials.blogspot.in/2012/05/custom-spinner-in-android.html
<一个href=\"http://androidexample.com/Custom_Spinner_With_Image_And_Text_-_Android_Example/index.php?view=article_discription&aid=84&aaid=107\" rel=\"nofollow\">http://androidexample.com/Custom_Spinner_With_Image_And_Text_-_Android_Example/index.php?view=article_discription&aid=84&aaid=107
http://www.edureka.in/blog/custom-spinner -in-的Android /
的http://stephenpengilley.blogspot.in/2013/01/android-custom-spinner-tutorial.html
的http://androidgeisha.blogspot.in/2011/01/custom-spinner-row-layout-custom.html
http://karanbalkar.com/2013 / 07 /教程39创建定制微调功能于安卓/
I want to write a custom adapter which is able to display custom View and I want if standard radio buttons are visible in dropdown list. I know roughly how to write a custom adapter but I am not sure how to preserve radio from standard drop-down-view which is visible in spinner:
spinner = new Spinner(ctx);
ArrayAdapter<T> data = new ArrayAdapter<T>(ctx, android.R.layout.simple_spinner_item, tclass.getEnumConstants());
data.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
If the last line is commented then the radio button is not used.
I am not sure if simple_spinner_dropdown_item.xml
layout contains textview and radio button.
- How to obtain
simple_spinner_dropdown_item.xml
? - How are radio buttons managed in spinner? Is that internally or do I need to implement it in customadapter?
I was looking in source of ArrayAdapter
, SimpleAdapter
code but there is nothing about it.
Here is the examples for custom spinner...
http://easyandroidtutorials.blogspot.in/2012/05/custom-spinner-in-android.html
http://www.edureka.in/blog/custom-spinner-in-android/
http://stephenpengilley.blogspot.in/2013/01/android-custom-spinner-tutorial.html
http://androidgeisha.blogspot.in/2011/01/custom-spinner-row-layout-custom.html
http://karanbalkar.com/2013/07/tutorial-39-create-custom-spinner-in-android/
这篇关于Android的微调如何显示下拉列表单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!