将imageView中的图像与底部中心对齐

问题描述:

我有一个简单的imageView,我希望图像显示在底部中央.此刻它显示在右下角.

I have a simple imageView and I want an image to be displayed in the center of the bottom. At the moment it is displayed in the bottom right corner.

<ImageView
      app:srcCompat="@android:drawable/simple_picture"
      android:id="@+id/picture"
      android:layout_centerHorizontal="true"
      android:layout_height="300dp"
      android:layout_width="330dp"
      android:scaleType="fitEnd"/>

是否可以将scaleType用于底部中心?

is there any way to use scaleType for bottom and center?

谢谢!

将父级布局添加为相对

<ImageView
            android:id="@+id/picture"
            android:layout_width="250dp"
            android:layout_height="350dp"


            android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
            android:layout_gravity="bottom"

            app:srcCompat="@drawable/oldman1" />