【发布时间】:2010-11-30 09:21:17
【问题描述】:
如何让 LinearLayout(或任何其他 ViewGroup)假设其子视图的大小而不是假设背景图像的大小?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/large_image300x300pix">
<TextView android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello world!"/>
</LinearLayout>
线性布局变得与背景图像大小相同。 如何让我的线性布局假定与 textview 相同的大小?
【问题讨论】:
标签: android background