下面的代碼:相對佈局給予了很多麻煩
<RelativeLayout
android:id="@+id/tc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tc"
android:layout_marginLeft="185dip"
android:layout_marginTop="25dip"
>
<ImageView
android:id="@+id/tc_icon"
android:background="@drawable/count_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/tc"
android:layout_mar
/>
<TextView
android:id="@+id/tc_icon_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:text="1"
android:layout_gravity="bottom"
android:textColor="#f7e906"
android:textStyle="bold"
/>
</RelativeLayout>
我也總算使圖像和文本的意見相互重疊(我想)。現在,我希望它們被放置在它們的父親RelativeLayout的左下角(ID爲'tc')....但是,它們不會移動。
如果我使用alignParentBottom ....整個相對佈局在整個屏幕上延伸並對齊到它的父親relativeLayout。
請幫忙。謝謝! :)
你可以放置一個佈局的草圖? – Riskhan 2013-02-25 05:45:37
提供佈局草圖........... – 2013-02-25 05:46:24
alignParentBottom和父母layout_height = wrap_content相互矛盾。在佈局上應用一些高度,你會看到不同之處。 – 2013-02-25 05:57:09