android.support.v4.widget.CircleImageView does not work

前端 未结 8 1458
独厮守ぢ
独厮守ぢ 2021-01-30 04:11

when I try to use : android.support.v4.widget.CircleImageView

        

        
相关标签:
8条回答
  • 2021-01-30 04:49

    If you want to do it in a native style just use this snippet

                <android.support.v7.widget.CardView
                    android:id="@+id/view2"
                    android:layout_width="45dp"
                    android:layout_height="45dp"
                    android:background="#ffffff"
                    android:shape="ring"
                    app:cardCornerRadius="23dp">
    
                    <ImageView
                        android:id="@+id/profile_img_post"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_alignParentTop="true"
                        android:layout_centerHorizontal="true"
                        android:scaleType="centerCrop"
                        android:src="@drawable/test_img"></ImageView>
                </android.support.v7.widget.CardView>
    
    0 讨论(0)
  • 2021-01-30 04:51

    dependency:

    compile 'de.hdodenhof:circleimageview:2.0.0'
    

    code:

    <de.hdodenhof.circleimageview.CircleImageView
                   android:id="@+id/iv_circle"
                   android:layout_width="96dp"
                   android:layout_height="96dp"
                   android:layout_alignParentLeft="true"
                   android:layout_alignParentTop="true"
                   android:src="@drawable/thumb"
                   app:border_color="@color/white"
                   app:border_width="2dp" />
    
    0 讨论(0)
提交回复
热议问题