-
Notifications
You must be signed in to change notification settings - Fork 304
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
Android P(9.0) 圆角失效 #37
Comments
贴一下代码和截图 |
代码:
问题: 原因: canvas.clipPath()和硬件加速引起 关闭硬件加速可以解决问题,是否有其他解决方案 |
测试发现是Android 9系统以下的绘制发生了改变导致的 |
谢谢反馈 |
圆形和圆矩用ViewOutlineProvider倒是一个好的替代方案,单个角要角度好像不行,setConvexPath没有效果
https://developer.android.google.cn/reference/android/graphics/Outline.html#canClip() |
` public void onClipDraw(Canvas canvas) {
我兼容了一下Android P 不过RCImageView在有些情况会有问题〜〜 |
在 v1.8.0 版本修复了该问题。 |
一加6(Android 9.0)设备问题依然存在 |
没有一加的设备,不知道一加是否自己修改了API的实现方式。 |
小米MIX2S(Android 9.0)还是有问题, 会出现RCRelativeLayout被背景色填充 |
如果把硬件加速关了, 可能会出现如下的报错, 导致整个View不显示, 变成透明 |
@summer0906 我已经解决了,看下我的代码。在小米 mi8 (9.0) ,运行得很好!
|
Where did you put this code? (I have the same problem on Moto G6) |
9.0的兼容之前修复了的 用最新版即可 2da96e0 |
I've got v1.8.1 and using "com.gcssloop.widget.RCRelativeLayout". |
@Cand3h If you set the background in the internal layout, can you solve your problem?
|
管用,原理能解释下吗,看的有点绕。。 |
原理就是对整个布局的 背景 切一下。 还有另外一个的解决方法,看下面代码:
|
主要原因是安卓p把paint默认的xfermode改了,核心部分是
|
RCRelativeLayout设置圆角后,View会填充为背景色
The text was updated successfully, but these errors were encountered: