展会信息港展会大全

如何完成方形带圆角的ImageView?
来源:互联网   发布日期:2016-01-14 11:31:41   浏览:2780次  

导读:dependencies { compile 'it.sephiroth.android.library.imagezoom:imagezoom:+' } ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:app=http://schemas.android.com/apk/res-auto androi...

dependencies {

compile 'it.sephiroth.android.library.imagezoom:imagezoom:+'

}

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:app="http://schemas.android.com/apk/res-auto"

android:orientation="vertical"

android:layout_width="match_parent"

android:layout_height="wrap_content">

<com.makeramen.roundedimageview.RoundedImageView

android:id="@+id/topic_avatar"

android:src="@drawable/loading"

android:background="@drawable/topic_image_border"

android:scaleType="fitXY"

app:riv_oval="false"

app:riv_tile_mode="repeat"

app:riv_corner_radius="5dp"

android:layout_marginLeft="10dp"

android:layout_alignParentLeft="true"

android:layout_centerVertical="true"

android:layout_width="60dp"

android:layout_height="60dp" />

</RelativeLayout>

private void initView(Bitmap loadedImage) {

topicAvatar = (ImageView) findViewById(R.id.topic_avatar);

topicAvatar.setImageBitmap(loadedImage);

}

赞助本站

人工智能实验室

相关热词: android开发 android教程

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港