我有我试图显示自定义视图,但我看到它了一堆抖动。一切卷轴缓慢,这是因为没有响应,因为它应该的。
I have a custom view that I am trying to display, however I am seeing a bunch of jitter on it. Everything scrolls slow and it isn't as responsive as it should be.
我用traceview,看见
I used traceview and saw that
GLES20Canvas.nDrawDisplayList
GLES20Canvas.nDrawDisplayList
似乎负责采取了大量的时间来执行。
seems responsible for taking a lot of time to execute.
任何帮助吗?
GLES20Canvas.nDrawDisplayList预计将有时间的很大一部分,如果你画了很多,尤其是非常大的意见。如果您看到这一切在你的traceview答案是抽取更少
GLES20Canvas.nDrawDisplayList is expected to have a large portion of the time if you are drawing a lot, especially very big views. If you are seeing this all over your traceview the answer is "DRAW LESS"
在我的具体问题,我画了大美景的大型阿尔法层。我建议阅读做的和不要的从 Android 3.0的硬件加速通过罗曼盖伊
In my specific issue I was drawing a large alpha layer over large views. I would recommend reading the Do's and Dont's from Android 3.0 Hardware Acceleration by Romain Guy