有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java scaleType未编辑我的imageView的位置

我制作了一个小视频,应该可以显示我的问题。如果我试着把它写出来,那就很清楚了

我拖动图像,然后尝试使用scaleType更改它,如我正在观看的教程视频所示(很可能是安卓 Studio的旧版本)。当他这样做时,它会改变屏幕图像的位置。然而,当我这样做的时候,什么都没有发生

https://www.youtube.com/watch?v=48oBhEMKanM

我添加了一个描述,但问题仍然存在。当我使用scaleType编辑时,在XML中会出现以下错误: https://i.imgur.com/jJ9NNur.png

当我按alt+enter自动修复时。它将这一行添加到我的代码中。如果我再次更改scaleType,我会得到相同的错误

这基本上就是我想要实现的:

https://www.youtube.com/watch?v=UATh8W1kyOg&feature=youtu.be

这是到目前为止我的XML代码:

<ImageView
    安卓:id="@+id/imageView7"
    安卓:layout_width="360dp"
    安卓:layout_height="416dp"
    安卓:layout_marginEnd="8dp"
    安卓:layout_marginTop="16dp"
    安卓:adjustViewBounds="true"
    安卓:contentDescription="sdfsfs"
    安卓:cropToPadding="true"
    安卓:scaleType="fitStart"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="1.0"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.0"
    app:srcCompat="@drawable/main_title"
    安卓:layout_marginRight="8dp" />


共 (0) 个答案