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

背景颜色透明效果 #2

Open
gangjin1991 opened this issue Oct 29, 2019 · 2 comments
Open

背景颜色透明效果 #2

gangjin1991 opened this issue Oct 29, 2019 · 2 comments

Comments

@gangjin1991
Copy link

我用这个自定view给它设置了半透明的背景,canvas.drawColor(viewBg);在这里,viewBg里设置了透明效果,初始化的时候温度计不透明,按键点击重绘才会透明,请教下是什么原因?

@liuxiaodongdefault
Copy link

我用这个自定view给它设置了半透明的背景,canvas.drawColor(viewBg);在这里,viewBg里设置了透明效果,初始化的时候温度计不透明,按键点击重绘才会透明,请教下是什么原因?

解决了吗 我这里也出现这个问题了

@liuxiaodongdefault
Copy link

解决了 是设置图片混合模式的原因 在ondraw方法中添加如下代码
mPaint.setXfermode(null);

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