0

我有一个相对布局,并且想要一个填充其高度的左对齐视图:

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#FF0" >

    <LinearLayout
        android:id="@+id/stripe"
        android:layout_width="20dp"
        android:layout_height="fill_parent"
        android:background="#F00"
        android:layout_alignParentLeft="true" 
        android:layout_alignParentTop="true"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/stripe" 
        android:layout_alignParentTop="true" 
        android:text="Some long string." />
</RelativeLayout>

我看到为“条纹”保留的 20dp 宽度,但没有得到预期的红色填充。我确定“条纹”视图的可见性设置为可见(而不是不可见)。知道为什么这不起作用吗?

谢谢

4

0 回答 0