android source

image 를 rounding 으로 표시

리오파파 2024. 4. 28. 22:22

image를 rounded corner로 표시하는 방법

 

xxlayout.xml에 shapeable 정의

    <com.google.android.material.imageview.ShapeableImageView
        android:id="@+id/imgU"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_marginStart="16dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.4"
        app:shapeAppearance="@style/circularImage"
        app:srcCompat="@drawable/karim" />

 

style.xms에 circularimage.xml 정의 (50%면 완전한 원)

<style name="circularImage">
    <item name="cornerSize">50%</item>
</style>

 

 

'android source ' 카테고리의 다른 글

startActivityForResult deprecated  (0) 2024.05.12
Menu icon 간격 적게 하는 법  (0) 2024.04.26
text prompted box input  (0) 2024.03.28
toolbar menu width adjust  (0) 2024.03.03
imageview with rounded corner  (0) 2023.12.19