任何人都知道在 android 布局 XML 中,可以嵌入到 XML 中的最大 View 限制是多少?有没有限制?
最佳答案
严格来说,“限制”是 80。
当布局中的 View 过多时,Lint 会报告以下内容:-
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.
但是,我使用的表格布局使我的 View 数量增加了一些(主要是 TextViews),但我没有遇到任何问题。我没有费心去改变 ANDROID_LINT_MAX_VIEW_COUNT 变量。
关于android - Android xml布局中的 View 限制是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34153362/