开发者

Strange title corruption of activity when using ListView

I've got a class (let's call it MyWidget for now) that extends View in which I do some custom drawing in onDraw(). MyWidget works just fine in most situations, except when either adding MyWidget to a ListView or a ScrollView within a TabView. When in one of these configurations, I consistently observe that scrolling will occasionally overwrite the title area of the View with a partial image of the cont开发者_开发知识库ents of one of the instances of MyWidget.

I know this is a really confusing description of the problem so Here's a screenshot of the corruption:

screen corruption

Any ideas?!

Addition: clipping logic that I use:

try {
        canvas.save(Canvas.ALL_SAVE_FLAG);
        // do some clipping here
    } finally {
        canvas.restore();
}


It looks like your View's custom drawing code is doing tricks with the clip rect and you are not properly saving/restoring the Canvas state.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜