빈 구멍 채우기
[Android]Glide fitXY
⭐⭐기록
2021. 8. 11. 12:02
Glide의 ScaleType관련 옵션이 fitCenter()와 centerCrop()밖에 없다는 것을 확인했다.
fitXY는 어떻게 할 것인가 고민했는데, 금방 해결이 됐다.
이미지뷰의 adjustViewBounds 값을 true로 지정해 주니 해결됐다.
Glide에 다른 옵션 설정은 하지 않았다.
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:minHeight="230dp"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>