android - 如何在android中将圆形 ImageView 背景设置为黑色?

标签 android android-imageview

Image View背景只反射(reflect)在圆圈内,不反射(reflect)在圆圈外。 我尝试了很多东西,但做不到。 任何人请我。 谢谢!!

最佳答案

在 drawable 文件夹中创建一个 .xml 文件,内容如下:

<?xml version="1.0" encoding="utf-8"?>
<shape
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:shape="oval">
     <solid
        android:color="@color/black"/>
</shape>

然后将此文件设置为您的背景。

关于android - 如何在android中将圆形 ImageView 背景设置为黑色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46070619/

相关文章:

android Lollipop 通知白色空圆圈

android - 我可以将普通 View 用作小部件吗?

android - BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions) 返回 FileNotFoundException

java - Android Constraint Layout - 将一个ImageView移动到另一个ImageView

android - 比屏幕大的ImageView作为背景

android - 如何获取领域层的字符串资源

Android行加载动画

android - NestedScrollview 中元素上的 Clicklistener/Touchlistener 会拦截滚动

android - 如何在两个图像布局之间画线

android - 如何在更新gridview时避免闪烁?