我的微调器是这样定义的,似乎 android:divider="#66BC31" 没有效果,我仍然得到白色分隔线:
<Spinner
android:id="@+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dip"
android:layout_marginBottom="15dip"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:textColor="#ffffff"
android:divider="#66BC31"
android:background="@drawable/spina" />
这是我的代码,我在其中更改微调器字体并选择下拉资源:
ArrayAdapter<String> adapter = new ArrayAdapter<String>(Roaming.this,
R.layout.roaming_spinner, data) {
public View getView(int position, View convertView, ViewGroup parent) {
View v = super.getView(position, convertView, parent);
Typeface externalFont = Typeface.createFromAsset(getAssets(),
"fonts/HelveticaNeueLTCom-Lt.ttf");
((TextView) v).setTypeface(externalFont);
return v;
}
public View getDropDownView(int position, View convertView,
ViewGroup parent) { // we need this so we can use custom
// font for spinner (open)
View v = super.getDropDownView(position, convertView, parent);
Typeface externalFont = Typeface.createFromAsset(getAssets(),
"fonts/HelveticaNeueLTCom-Lt.ttf");
((TextView) v).setTypeface(externalFont);
return v;
}
};
adapter.setDropDownViewResource(R.layout.roaming_spinner_row);
我还尝试将行 android:divider="#66BC31" 添加到 roaming_spinner_row.xml 和 roaming_spinner.xml ,其中声明了我的关闭和打开的微调器的文本大小和颜色,但再次没有成功。