【发布时间】:2014-10-22 21:09:28
【问题描述】:
我正在使用微调器,它像对话框一样打开。我需要像下拉菜单一样打开微调器。
这是xml文件
<Spinner
android:id="@+id/sp_countrycode_issue_coupon"
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginLeft="3dp"
android:layout_weight="1"
android:background="@drawable/img_small_box_green"
android:dropDownSelector="@drawable/img_small_box_green"
android:gravity="right|center"
android:textAlignment="center" />
这里是代码
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
this, R.array.country_code,
android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(R.layout.spinner_textview);
sp_country_code.setAdapter(adapter);
我在下面发布了我的图片,就像我的视图和微调器显示视图一样。但我需要像第三张图片一样显示微调器
【问题讨论】:
-
你测试的是哪个安卓版本?
-
目前是安卓 4.1。但同样的东西也显示在 2.3 及以下版本
标签: android android-layout spinner