gpt4 book ai didi

java - 图像布局安卓

转载 作者:行者123 更新时间:2023-12-02 05:30:32 26 4
gpt4 key购买 nike

android xml 中有我的布局,但图像不在布局的顶部。可能是什么问题?

enter image description here

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<ImageView android:id="@+id/description_imageview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/hand"
android:contentDescription="@string/app_version"/>

<TextView android:id="@+id/first_help_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="sdsjkfhsdjkfhsdkjfh skdfjh skjdfh skdjfh skjdfh skjdfh skjdhfk jshdfkjh jskdfh skjdfh skdjfh skdjfh skdjfh skjdfh skjdfh skjdfh kjsdhf kjsdhfk jhs"/>
</LinearLayout>
</ScrollView>
</LinearLayout>

添加比例类型: enter image description here

enter image description here

最佳答案

尝试将 scaleType 设置为您的 ImageView

 android:scaleType="fitXY"

编辑:尝试更改 LinearLayout 高度:

<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

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

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