1

以下に示すように、xmlを使用してスピナーをスタイル/カスタマイズするにはどうすればよいですか? ボーダー付きの白い背景を作成できますが、左にアイコン、右に矢印を設定できません。

ここに画像の説明を入力

4

1 に答える 1

0

アイコンを左に、矢印を右に設定するレイアウトに問題がある場合は、次のように動作するはずです。

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />

    <ImageView
        android:id="@+id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true" />

    <TextView
        android:id="@+id/name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/icon" />

    <ImageView
        android:id="@+id/arrow"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true" />

</RelativeLayout>

私は仕事中なので、これをテストすることはできませんが、うまくいくはずです。

于 2012-08-13T12:44:16.320 に答える