Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

动态设置背景颜色无效 #19

Closed
zyyoona7 opened this issue Jul 5, 2018 · 2 comments
Closed

动态设置背景颜色无效 #19

zyyoona7 opened this issue Jul 5, 2018 · 2 comments

Comments

@zyyoona7
Copy link

zyyoona7 commented Jul 5, 2018

通过

shadowView.setBackgroundClr(Color.BLACK);

设置背景颜色无效,设置背景没有更新画笔颜色

private fun updateBackgroundClr(bgColor:Int){
    //起作用
    bgPaint.color=bgColor
    invalidate()
}
@elmliu
Copy link

elmliu commented Mar 2, 2019

具体怎么改源码啊.. 我下载了zip包,编辑后尝试重新导入,但总是没法正常使用

@zyyoona7
Copy link
Author

zyyoona7 commented Mar 5, 2019

@elmliu 在 ShadowView 的 41-46 行

    var backgroundClr: Int = 0
        set(value) {
            field = value
            invalidate()
        }

将 invalidate() 替换成我上面的 updateBackgroundClr(field) 方法就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants