[英]Empty linear_layout with wrap_content glitch
我有高度设置为wrap_content的空LinearLayout,它占用了太多空间。 应该为padding或为零,但大约需要80dp。 为什么? 它很奇怪。
(与内部任何数量的儿童相同,应该只占用空间以“掩盖”儿童,但要占用更多空间)
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/blue_bg"
</LinearLayout>
编辑:
我找到了原因。 背景可绘制对象可扩展LinearLayout。 荒谬。 如何解决这个问题?
缩小背景。 您可能要使用9 PNG来使图像在布局中很好地拉伸。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.