PAG lib是否支持在子线程中加载动画资源? #2474
Answered
by
kevingpqi123
aSmartTortoise
asked this question in
Q&A
-
众说周知,Android 原生的SurfaceView也可以实现动画,且很好地避免了View在执行动画过程中对主线程的负载,请问PAG lib是否有对应的组件(控件)能实现类似原生的SurfaceView在子线程中加载动画? |
Beta Was this translation helpful? Give feedback.
Answered by
kevingpqi123
Sep 19, 2024
Replies: 1 comment 4 replies
-
PAGView 和 PAGImageView 默认就是在子线程中渲染,只有上屏在主线程,你这边遇到的具体问题是啥 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1、对于 PAGView 或 PAGImageView 而言,如果 View 处于不可见的状态,是不会触发渲染的,如果是第一次加载,首帧涉及到构建渲染环境和缓存,会慢一些;
2、上屏只能在主线程哈,子线程无法上屏,你这边如果遇到性能问题,可以把具体的案例发出来,pag 已经发展了这么多年,基础的性能层面我们都考虑到了,你可以在任意的线程中使用 PAGView 或 PAGImageView