Android: How to redraw a graphic element?

前端 未结 2 1094
长情又很酷
长情又很酷 2020-12-16 12:54

I have created a class RoundIcon which extends View and the class contains setIconImage() method:

public void setIconImage(int imageFromResources) {
    icon         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 13:46

    Definitely call invalidate instead of refreshDrawableState(). You might want to check what thread your on and if on a background call postInvalidate().

提交回复
热议问题