2013-05-01 148 views
0

我有这样的布局内部RelativeLayout对齐在相对布局

<LinearLayout 
    android:id="@+id/llWatchItemCommentButton" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" > 

    <TextView 
     android:id="@+id/myMasterCat_Item" 
     style="@style/DropShadowEffect" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="10dp" 
     android:layout_weight="99" 
     android:shadowColor="#ffffff" 
     android:text="Item" 
     android:textColor="#515b61" 
     android:textSize="22sp" /> 

    <ImageView 
     android:id="@+id/bFollowComment" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/featured_button_selector" 
     android:padding="5dp" 
     android:src="@drawable/comment" /> 
</LinearLayout> 

    <TextView 
    android:id="@+id/myMastCat_Cat" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignBottom="@+id/llWatchItemCommentButton" 
    android:layout_alignLeft="@+id/llWatchItemCommentButton" 
    android:layout_marginLeft="10dp" 
    android:text="MasterCat" 
    android:textColor="#666" 
    android:textSize="16sp" /> 

本质上,如果在布局TextView变为两行,其将与TextView positioned below the LinearLayout`重叠。

是否有一个属性也许可以纠正?就像在中,我希望底部TextView在任何时候都低于整个LinearLayout,即使它开始增长。现在,这个职位似乎是固定的。

回答

1

你有没有试过如下:

<TextView 
android:id="@+id/myMastCat_Cat" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_below="@id/llWatchItemCommentButton" //add this line in 
android:layout_alignBottom="@+id/llWatchItemCommentButton" 
android:layout_alignLeft="@+id/llWatchItemCommentButton" 
android:layout_marginLeft="10dp" 
android:text="MasterCat" 
android:textColor="#666" 
android:textSize="16sp" />