android
constraint dimension ratio
boywin1992
2022. 5. 28. 03:42
728x90
android:layout_width="0dp" or android:layout_height="0dp"
app:layout_constraintDimensionRatio="***:***"
example)
<ImageView
android:id="@+id/main_banner"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="44dp"
android:layout_marginEnd="20dp"
android:background="#26CBCBCB"
android:backgroundTint="@color/white"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="335:280"
app:layout_constraintTop_toBottomOf="@+id/home_user_menu_layout"
tools:layout_editor_absoluteX="20dp" />
728x90