【发布时间】:2014-07-01 07:38:10
【问题描述】:
我想减小/更改微调器尺寸,其中包括:
- 微调器对象大小
- 显示的字体(大小和颜色)
- 当我打开微调器时显示的列表视图(其字体大小和颜色)
【问题讨论】:
我想减小/更改微调器尺寸,其中包括:
【问题讨论】:
您可以在布局文件中更改这些设置。 hello-spinner 教程非常有用。
http://developer.android.com/guide/tutorials/views/hello-spinner.html
将新的 XML 文件添加到您的布局文件夹。
示例:spinnerLayout.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinnerTarget"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="14pt"
android:textColor="#FF8B1500"
android:gravity="center"/>
将适配器资源更改为您的新布局文件:
adapter = ArrayAdapter.createFromResource(
this, R.array.sound, R.layout.spinnerLayout);
【讨论】:
android:padding="0dip"
在我的微调器中使用
使其更小android.R.layout.simple_spinner_item
当制作阵列适配器时,它似乎也变小了,但我不知道这是否是明智之举。
【讨论】: