我試圖將LinearLayout的背景更改爲某些木材紋理,但它會根據木製背景的尺寸更改LinearLayout的寬度和高度! 我需要LinearLayout忽略背景尺寸!更改LinearLayout的背景會改變它的寬度和高度
<LinearLayout
android:id="@+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/wood"
android:orientation="vertical" >
some content here which I need to wrap height to them!
</LinearLayout>
可能是有用的:http://stackoverflow.com/questions/8202647/setting-a-background-image-to-a-view-stretches-my-view – 2014-11-01 08:44:17