我正在尝试复制微调器控件(请不要问为什么)我正在努力使用分隔线。假微调器看起来不错,直到我将分隔线添加到图像视图的左侧。一旦我添加了分隔线,它的高度就会填满屏幕的剩余部分。有人可以解释一下吗?
以下xml:
…………
<Spinner
android:id="@+id/equipment_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"/>
<ImageView
android:id="@+id/spinner_arrow"
android:layout_width="45sp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/spinner_arrow"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
产生以下屏幕:
添加分隔线后,xml 如下所示:
<Spinner
android:id="@+id/equipment_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"/>
<ImageView
android:id="@+id/spinner_arrow"
android:layout_width="45sp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/spinner_arrow"/>
<View
android:background="#e7ebe7"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_toLeftOf="@id/spinner_arrow"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
这会产生以下屏幕:
谁能发现我在这里做错了什么?...