如何让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>线性布局变得与背景图像的大小相同。如何才能使我的线性布局与文本视图的大小相同?
发布于 2010-11-30 19:15:33
如果您的图像适合转换为可缩放的9面片图像,那么这样做将导致背景围绕TextView缩放。
https://stackoverflow.com/questions/4312133
复制相似问题