D
D
dimasik1002002018-03-19 17:18:25
Java
dimasik100200, 2018-03-19 17:18:25

How to make the images in the recycler view (grid layout) so that the images are of the same shape in the form of a square?

How to make the images in the recycler view (grid layout) so that the images are of the same shape in the form of a square?
Here is the xml that the recycler view works with.

<android.support.constraint.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?android:attr/selectableItemBackground"
    android:layout_margin="1dp">

    <ImageView
        android:id="@+id/tile_picture"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:scaleType="centerCrop"
        tools:src="@drawable/city" />

</android.support.constraint.ConstraintLayout>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question