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 回答