1 <?xml version="1.0" encoding="utf-8"?> 2 <RelativeLayout 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 xmlns:tools="http://schemas.android.com/tools" 5 android:id="@+id/activity_main" 6 android:layout_width="match_parent" 7 android:layout_height="match_parent" 8 tools:context="com.example.nanchen.cropimagetest.MainActivity"> <com.example.nanchen.cropimagetest.RoundImageView 12 android:id="@+id/main_roundImage" 13 android:layout_width="100dp" 14 android:layout_height="100dp" 15 android:layout_alignParentTop="true" 16 android:layout_centerInParent="true" 17 android:src="@drawable/default_avatar"/> 18 19 <Button 20 android:id="@+id/main_btn" 21 android:layout_width="match_parent" 22 android:layout_height="wrap_content" 23 android:layout_below="@+id/main_roundImage" 24 android:onClick="btnClick" 25 android:text="设置头像"/> 26 </RelativeLayout>
最后,再次对大家表示歉意,代码有些地方讲解不是很到位,后面我把毕设完全做出来后也会开源给大家,供大家一起交流使用,请持续关注~
github链接:https://github.com/nanchen2251/CropImageDemo