2

我有一个包含 ImageView 或 TextView 的 RelativeLayout。我打电话:

relativeLayout.setRotation(8);

ImageView 和 TextView 有倾斜的边缘,我想删除。

屏幕图像

到目前为止我已经尝试过:

覆盖所有布局和视图以添加:

protected void dispatchDraw(Canvas canvas) {
    canvas.setDrawFilter(new PaintFlagsDrawFilter(0, 
        Paint.DEV_KERN_TEXT_FLAG | Paint.SUBPIXEL_TEXT_FLAG | 
        Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG | 
        Paint.DITHER_FLAG)
    );
    super.dispatchDraw(canvas);
}

有人有想法吗?

4

1 回答 1

0

尝试将 PaintFlagsDrawFilter 设置为 1 而不是 0:

    protected void dispatchDraw(Canvas canvas) {
    canvas.setDrawFilter(new PaintFlagsDrawFilter(1, 
        Paint.DEV_KERN_TEXT_FLAG | Paint.SUBPIXEL_TEXT_FLAG | 
        Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG | 
        Paint.DITHER_FLAG)
    );
    super.dispatchDraw(canvas);
}
于 2013-11-29T15:11:46.630 回答