带背景的 ImageView 半径
ImageView radius with background
我有一个 ImageView
有背景。我需要将 border-radius
设置为我的 ImageView
。我在另一个 XML 文件中使用下面的代码并将其设置为 android:src
但是当我设置背景时它不起作用。
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="10dp"/>
</shape>
如何同时设置背景和半径?
背景可以和border-radius一起设置xml。
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="10dp"/>
<!-- background -->
<solid android:color="@android:color/white" />
</shape>
我有一个 ImageView
有背景。我需要将 border-radius
设置为我的 ImageView
。我在另一个 XML 文件中使用下面的代码并将其设置为 android:src
但是当我设置背景时它不起作用。
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="10dp"/>
</shape>
如何同时设置背景和半径?
背景可以和border-radius一起设置xml。
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="10dp"/>
<!-- background -->
<solid android:color="@android:color/white" />
</shape>