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

圓角有時會失效,變成方角. #20

Open
fox0830 opened this issue Oct 24, 2019 · 6 comments
Open

圓角有時會失效,變成方角. #20

fox0830 opened this issue Oct 24, 2019 · 6 comments

Comments

@fox0830
Copy link

fox0830 commented Oct 24, 2019

A activity裡面有圓角圖片,跳轉到B activity,從B返回A後,A頁面的圓角圖片就失效了

@JairusTse
Copy link

9.0有这个bug

@itning
Copy link

itning commented Nov 20, 2019

9.0 也遇到了这个问题如何解决?

@huangbqsky
Copy link

也是偶现圆角失效

@jefshi
Copy link

jefshi commented Dec 19, 2019

碰到的具体情况:
步骤1:A activity裡面有圓角圖片,跳轉到B activity,從B返回A後

说明:执行步骤1,A頁面的圓角失效了。重复步骤1,圓角又好了。再重复圓角又失效了。再重复圓角又好了。如此循环

机型:华为 mate 20,Android 9.0

@uuuBird
Copy link

uuuBird commented Dec 27, 2019

if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O_MR1) {
canvas.drawPath(path, paint);
} else {
srcPath.addRect(srcRectF, Path.Direction.CCW);
// 计算tempPath和path的差集
srcPath.op(path, Path.Op.DIFFERENCE);
canvas.drawPath(srcPath, paint);
srcPath.reset();//1
}
再onDraw方法中添加注释1处的代码就好了

@haojinyu
Copy link

A activity裡面有圓角圖片,跳轉到B activity,從B返回A後,A頁面的圓角圖片就失效了
//需要开启硬件加速
<application
android:hardwareAccelerated="true"

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

7 participants