In a ConstraintLayout
, an ImageView
is bound to its parent in such a way that:
Its left side is bound to the screen\'s left side
In addition to the last answer, the reason your image is not being scaled properly is because you are using it as the background.
Your code..
android:background="@drawable/ic_background_stars"
Instead, use it as image resource.
app:srcCompat="@drawable/ic_background_stars"
And the default scale type of ImageView should do the work for you. Else, you can even experiment with various scale types.
I think that you can use app:layout_constraintDimensionRatio="your ratio"
to keep the aspect ratio if your image
For example, if you want square you need the same width and height so use - app:layout_constraintDimensionRatio="1:1"