[英]Background image not filling layout and taking extra space above and below
The blue bordered part is a LinearLayout
and the white card part is the background image I have used. 带蓝色边框的部分是
LinearLayout
而带有白卡的部分是我使用的背景图像。 The background image is not filling the layout. 背景图像未填充布局。
I have tried keeping an ImageView
in a FrameLayout
and making scale type as centerCrop but even that didn't work. 我试图将
ImageView
保留在FrameLayout
,并将比例类型设置为centerCrop,但是即使这样也没有用。 I can use a CardView
instead but I want this type of shadow as shown in the picture which I couldn't achieve with attributes of CardView
. 我可以改用
CardView
但是我想要这种阴影,如图所示,这是CardView
属性无法实现的。
Here is my code: 这是我的代码:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/squared_background_shadow">
</LinearLayout>
LinearLayout
, which don't support by CardView
? LinearLayout
使用哪些特殊属性, CardView
不支持哪些特殊属性? android:scaleType="fitXY"
android:scaleType="fitXY"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.