What is the view limit in Android xml layout

后端 未结 2 1400
面向向阳花
面向向阳花 2021-01-05 11:46

Anyone have any idea about that in android layout XML, What is the maximum view limit that can be embedded into the XML? Is there any limit?

相关标签:
2条回答
  • 2021-01-05 12:30

    Strictly speaking the "limit" is 80.

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

    AndroidLintTooManyViews

    Description

    Layout has too many views Using too many views in a single layout is bad for performance. Consider using compound drawables or other tricks for reducing the number of views in this layout. The maximum view count defaults to 80 but can be configured with the environment variable ANDROID_LINT_MAX_VIEW_COUNT.

    However, I was using a table layout which blew my number of views by a few (mainly TextViews) and I have had no problems. I didn't bother to change the ANDROID_LINT_MAX_VIEW_COUNT variable.

    0 讨论(0)
  • 2021-01-05 12:45

    There are no certain things in android.You can use maximum views as much as you can.But one thing that needs to keep in mind, there should be maximum 3 level hierarchy.

    0 讨论(0)
提交回复
热议问题