Android - View too large to fit into drawing cache

2019-08-09 15:16发布

I have a class that extends custom view, it has to draw a line and some text like a timeline.
It can be pretty long so I put the view into a scrollview.
It works fine but if the line is too long the view disappears and become invisible (the ScrollView scrolls) and Logcat shows me this message:

07-02 15:56:05.209: W/View(7364): View too large to fit into drawing cache, needs 4392400 bytes, only 4096000 available

How can i solve this problem?
Thanks in advance.

1条回答
Luminary・发光体
2楼-- · 2019-08-09 15:49

There's no way to increase RAM, perhaps you can draw less. Remove ScrollView, detect touch on View, draw only visible portion.

查看更多
登录 后发表回答