我試圖設置背景到RelativeLayout。 問題在於佈局在圖像大小之後調整大小,這是我不想要的。我希望佈局在兩個文本瀏覽後進行大小調整。防止佈局調整後背景
無論如何,以防止佈局縮放到背景的大小?
這是XML的代碼
<RelativeLayout
android:id="@+id/hud"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@+drawable/hud_background"
android:layout_weight="1" >
<TextView
android:id="@+id/lblScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Score: " />
<TextView
android:id="@+id/txtScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/lblScore"
android:layout_alignBottom="@+id/lblScore"
android:layout_toRightOf="@+id/lblScore"
android:text="00" />
</RelativeLayout>
問候
能否請您再字呢? 「你的意思是」現在發生的圖像大小之後,佈局不應該調整大小?「 – yarian 2013-03-26 20:47:30
希望它現在更清晰一點 – Fredkr 2013-03-26 20:54:41
ouuh你的意思是相對佈局高度應該是textview1高度+ textview2高度,無論背景圖像大小..? – lelloman 2013-03-26 20:56:49