gpt4 book ai didi

安卓布局问题

转载 作者:行者123 更新时间:2023-11-29 17:47:15 24 4
gpt4 key购买 nike

我不想要 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" />

enter image description here

最佳答案

问题是 firStart 使用 Matrix.ScaleToFit 中的 START 常量,它只会选择缩放图像 x 或 y轴

documentation :

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 轴缩放图像

关于安卓布局问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25631371/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com