【问题标题】:Round image corner using custom widget使用自定义小部件的圆形图像角
【发布时间】:2012-10-08 18:38:53
【问题描述】:

我想为自定义列表中的图像设置圆角。我使用了以下链接中提到的自定义小部件方法:

http://wiresareobsolete.com/wordpress/2011/08/quick-rounded-corners/#comments

图像角落变得模糊。任何人都可以给我一个解决方案,让我使用这个mentod拥有光滑的角落。

【问题讨论】:

    标签: android imageview rounded-corners


    【解决方案1】:

    在drawable文件夹中创建一个文件。给它命名任何东西。并使用该文件设置imageview 背景。它会给你一个圆角。

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    
    <stroke android:width="1dip"
        android:color="@color/stroke_color"/>
    
    <solid android:color="@color/white"/>
    
    <padding 
        android:left="5dip"
        android:top="5dip"
        android:right="5dip"
        android:bottom="5dip" />
    
    <corners android:radius="5dip" />
    
    </shape>
    

    【讨论】:

    • 我试过这个,但图像没有填满宽度。图像和形状具有不同的宽度。所以形状很突出。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-18
    • 1970-01-01
    • 1970-01-01
    • 2021-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多