admin管理员组文章数量:1600685
成品app直播源码,设置图片圆角和圆形图片
在项目根目录下的build.gradle文件中,增加gradle地址:
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" } //增加这行
}
}
在app的module下,build.gradle文件中,增加依赖:
implementation 'com.github.SheHuan:NiceImageView:1.0.5'
圆角效果,设置app:corner_radius="10dp"就好了,对应的布局文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android/apk/res/android"
xmlns:app="http://schemas.android/apk/res-auto"
xmlns:tools="http://schemas.android/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.shehuan.niv.NiceImageView
android:id="@+id/iv"
android:layout_width="80dp"
android:src="@drawable/ju"
android:layout_height="80dp"
android:layout_centerInParent="true"
app:corner_radius="10dp"
/>
</RelativeLayout>
圆形图片,设置app:is_circle="true"就好,不需要设置app:corner_radius=“10dp”,对应的布局文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android/apk/res/android"
xmlns:app="http://schemas.android/apk/res-auto"
xmlns:tools="http://schemas.android/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.shehuan.niv.NiceImageView
android:id="@+id/iv"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:src="@drawable/ju"
app:is_circle="true" />
</RelativeLayout>
以上就是 成品app直播源码,设置图片圆角和圆形图片,更多内容欢迎关注之后的文章
版权声明:本文标题:成品app直播源码,设置图片圆角和圆形图片 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1728353325a1155321.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论