我有一個具有LinearLayout作爲包含TextViews的子項的RelativeLayout。RelativeLayout:不能使用帶有鏈接到LinearLayout子項的layout_below?
我想將ImageViews放置在layout_alignRight =「@ id/userdetail_tv_special」的TextViews的右側,但不知何故,這是行不通的。
無法將RelativeLayout的子元素「鏈接」到LinearLayout的子元素嗎?任何想法如何我可以實現這一點,而無需爲每個按鈕創建另一個RelativeLayout?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/userdetail_lin_btncontainer"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_below="@id/userdetail_lin_divider"
android:padding="6dp" >
<TextView
android:id="@+id/userdetail_tv_special"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Special"
android:background="#cccccc" />
<!-- here are more TextViews like this one -->
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@id/userdetail_tv_special"
android:src="@drawable/ic_detail_special" />
<!-- much more views and stuff -->
</RelativeLayout>
的LinearLayout中有5個TextViews與layout_width = FILL_PARENT和layout_weigth = 1〜STRETCH時他們填寫屏幕的整個寬度...有另一種可能做到這一點? – qedejavu 2011-02-10 14:50:16