我不希望imageview和以下textview之间的(黑色)空间。我究竟做错了什么?谢谢你的帮助。
<RelativeLayout
android:id="@+id/layout_contentView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/club_banner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitStart"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/condition_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@id/club_banner"
android:background="@drawable/overview_cell_header_bg"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="@string/Condition_1"
android:textColor="#ffffff"
android:textSize="13sp"
android:textStyle="normal" />
问题是firStart
使用的START
常数Matrix.ScaleToFit
只能选择缩放x轴或y轴的图像
说明文件:
Compute a scale that will maintain the original src aspect ratio,
but will also ensure that src fits entirely inside dst. At least one
axis (X or Y) will fit exactly.
解决方案:
您需要使用fitXY
来从x和y轴缩放图像
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句