Maximum view limit in Android xml layout

Does anyone have an idea about this in the android xml layout, how many maximum views do we have inside xml? Is there a limitation or not?

+5
source share
2 answers

Strictly speaking, the "limit" is 80.

Lint reports the following when you have too many views in the layout: -

AndroidLintTooManyViews

Description

A layout has too many views Using too many views in one layout is bad for performance. Consider using complex drawings or other tricks to reduce the number of views in this layout. The default maximum number of views is 80, but can be configured with the ANDROID_LINT_MAX_VIEW_COUNT environment variable.

However, I used a tabular layout that changed the number of views several times (mainly TextViews), and I had no problems. I did not change the variable ANDROID_LINT_MAX_VIEW_COUNT.

+4
source

There are no certain things in android. You can make the most of max views. But one thing that should be kept in mind should be a maximum three-level hierarchy.

+2
source

Source: https://habr.com/ru/post/1237642/


All Articles