小编Bor*_*ora的帖子

带有圆角的ImageView中的位图

我有一个ImageView,我想用它rounded corners.

我用这个:

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

    <stroke android:width="1dp"
            android:color="#ff000000"/>


    <corners android:radius="62px"/> 
</shape>
Run Code Online (Sandbox Code Playgroud)

并将此代码设置为我的imageview的背景.它可以工作,但我放在它上面的src图像ImageView是走出边界而不适应新的形状.

我该如何解决这个问题?

android bitmap rounded-corners imageview

47
推荐指数
7
解决办法
5万
查看次数

标签 统计

android ×1

bitmap ×1

imageview ×1

rounded-corners ×1