java - 图像布局安卓

标签 java android xml android-layout android-xml

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/

相关文章:

javascript - 计算无序列表中动态生成的列表元素的数量

xml - 哪种 XML 模式数据类型对于二进制数据来说是节省空间的?

xml - tsql 如何拆分 xml 并将它们作为行插入

java - 具有第三个值的 XYdataset Jfreechart 标签图

java - 为什么我只能看到来自 jmap -permstat 的 "dead"类加载器( Bootstrap 除外)?

android - 用于 Android 开发的 Maven 集成

android - 什么是工具 :layout_constraintBaseline_creator attribute in ConstraintLayout?

android - 如何在 Windows 上的 Crosswalk for Android 中检查 OpenSSL 的版本

执行JAR时java.lang.ClassNotFoundException : com. mysql.jdbc.Driver

java - 使用 var 的循环中的类型推断