Blurred 1dip shape lines (borders) on Android

青春壹個敷衍的年華 提交于 2019-12-06 05:57:12

My first guess would be that this is a problem with bi-linear filtration (http://en.wikipedia.org/wiki/Bilinear_filtering).

To fix it, see The View#setLayerType method.

I had an issue with this in a custom view. Inside my view's init method, I have the following code:

    if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB){
        this.setLayerType(View.LAYER_TYPE_SOFTWARE, null);          
    }

This fixed my issue, but you could do the same thing using the android:layerType xml attribute, or the setLayerType method in code on your view.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!