【发布时间】:2011-04-06 19:20:00
【问题描述】:
如何在微调器中放置 textcolr 并更改大小
【问题讨论】:
如何在微调器中放置 textcolr 并更改大小
【问题讨论】:
不,你当然可以改变它:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="50dip">
<RelativeLayout android:id="@+id/RelativeLayout02"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:text="@+id/TextView01"
android:layout_marginRight="10dip" android:id="@+id/imageNameSpinner" android:layout_alignParentLeft="true"
android:layout_centerInParent="false"
android:layout_centerHorizontal="false"
android:layout_centerVertical="true" android:textColor="@color/black_color" android:layout_marginLeft="10dip" android:layout_width="90dip" android:layout_height="50dip"></TextView>
<ImageView android:layout_marginRight="10dip"
android:id="@+id/imageIconSpinner" android:layout_marginLeft="10dip" android:layout_toRightOf="@+id/imageNameSpinner" android:layout_height="50dip" android:layout_width="50dip"></ImageView>
</RelativeLayout>
</RelativeLayout>
这是自定义微调器的 xml。它还显示了如何将图像视图包含在微调器中。
在定义适配器时按如下方式使用:
adapterForImageSpinner = new SimpleAdapter(this, true,
spinnerData, R.layout.spinner_view, new String[] { "Name",
"Icon" }, new int[] { R.id.imageNameSpinner,
R.id.imageIconSpinner });
【讨论】: