这是我的spinner XML文件,它不起作用:
1
2
3
4
5
6
7
|
<
Spinner
android:id
=
"@+id/frequency"
android:layout_width
=
"wrap_content"
android:layout_height
=
"wrap_content"
android:background
=
"@drawable/spinner_voices"
android:gravity
=
"center|center_horizontal"
/>
|
解决方法 1:
你需要设置你自己的spinner布局
1
2
|
ArrayAdapter adap =
new
ArrayAdapter<String>(
this
, R.layout.spinner_item,
new
String[]{
"ABC"
,
"DEF"
,
"GHI"
});
spriner.setAdapter(adap);
|
1
2
3
4
5
|
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
android:layout_height
=
"fill_parent"
android:layout_width
=
"fill_parent"
android:gravity
=
"center"
/>
|