2013-03-09 56 views
2

我有一個包含ImageView或TextView的RelativeLayout。我打電話給:包含ImageView圖像的Android RelativeLayout.setRotation具有角度邊緣

relativeLayout.setRotation(8); 

ImageView和TextView有傾斜的邊緣,我想刪除。

Screen Image

我迄今爲止嘗試:

覆蓋所有佈局和視圖補充:

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); 
} 

是否有人有想法?

回答

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); 
}