我有一个ImageView,我已经包装在LinearLayout中.LinearLayout有一个背景drawable,它基本上是一个边框,所以效果是我的图像周围有一个边框.
然而,无论我尝试什么,我的图像下面都会有一大块空白空间,这会将我的LinearLayout的下边缘向下推.我希望LinearLayout在没有填充的情况下紧紧包裹图像(除了我指定的1sp)
这就是我如何定义这两者
<LinearLayout
a:orientation="vertical" a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:gravity="top"
a:padding="1sp"
a:background="@drawable/heading_background">
<ImageView a:src="@drawable/photo"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:scaleType="fitStart"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
谁能告诉我我做错了什么?
谢谢