用 fresco 实现这个很方便 

首先在build.gradle里面添加依赖   compile'com.facebook.fresco:fresco:1.0.0'


然后在xml里面:

android:id="@+id/user_avatar"

android:layout_gravity="center_horizontal"

android:layout_marginTop="30dp"

android:layout_height="154px"

android:layout_width="154px"

fresco:roundAsCircle="false"

fresco:roundedCornerRadius="10dp"

fresco:placeholderImage="@drawable/head"

fresco:actualImageScaleType="focusCrop"

fresco:failureImage="@drawable/head"/>

更多相关文章

  1. Android(安卓)Studio导入第三方类库的方法
  2. 如何将Android例子程序添加到Eclipse进行调试运行
  3. android 去掉顶部状态栏
  4. 如何进行Android单元测试
  5. Android下单元测试
  6. 如何进行Android单元测试
  7. Android添加一个系统service
  8. Android(安卓)Studio导入项目常出现的问题
  9. 把TextView中的文字添加阴影效果及Style的使用

随机推荐

  1. 另一个div内的任意宽度的中心div
  2. css3+html5——拼接图片中icon的使用、照
  3. 认识DHTML中的“行为”组件
  4. 如何从input type = file中删除一个对象?
  5. 如何在jquery中增加itemtype的值?
  6. xml格式原样输出到html或是jsp页面
  7. 用HTML+CSS编写一个计科院网站首页的静态
  8. 布局的标记建议和一些更一般的问题
  9. IDEA SpringBoot入门与速查—HTML页与Thy
  10. sublime text3快速生成html头部信息