形状Android的模糊圆角

时间:2014-03-26 18:50:01

标签: android shape rounded-corners

我使用形状作为背景,如下所示:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle"
    >
    <corners
        android:radius="24dp" />

    <stroke android:width="1dp" android:color="@color/dark_gray" />

    <solid android:color="@color/sepia_bright" />


</shape>

创建圆角矩形。以下是该矩形的角落的样子:

enter image description here

你可以看到,一切都很模糊。当我关闭硬件加速时,我可以使线条更清晰(hardwareAccelerated =&#34; false&#34;)

enter image description here

但即使在更高密度的显示屏上,那个角落看起来仍然很糟糕。最后一个奇怪的是,它在手机上看起来要比具有相同密度的平板电脑好得多。

感谢您的帮助。

1 个答案:

答案 0 :(得分:2)

XML drawables在Android中是废话。除了用画布画自己之外,你无能为力。例如。你可以自己绘制一个自定义的Drawable。

相关问题