Relative Content

Tag Archive for android-constraintlayoutcenteringright-to-leftandroid-wrap-content

Why the view go outside of screen by ConstrainLayout in the condition of RTL?

Problem Here is my layout file: activity_main.xml <?xml version=”1.0″ encoding=”utf-8″?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/main” android:layout_width=”match_parent” android:layout_height=”match_parent” android:background=”@android:color/white”> <RelativeLayout android:id=”@+id/rl_next” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_marginBottom=”58dp” app:layout_constraintBottom_toBottomOf=”parent” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintStart_toStartOf=”parent”> <ImageView android:id=”@+id/iv_bg” android:layout_width=”136dp” android:layout_height=”60dp” android:src=”@drawable/bg_next_img” /> <ImageView android:id=”@+id/iv_arrow” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_centerInParent=”true” android:src=”@drawable/arrow” /> </RelativeLayout> </androidx.constraintlayout.widget.ConstraintLayout> And the drawable file mentioned above is here: arrow.xml <vector xmlns:android=”http://schemas.android.com/apk/res/android” android:width=”27dp” android:height=”22dp” android:autoMirrored=”true” android:viewportWidth=”27″ […]