android - Android xml布局中的 View 限制是什么

标签 android android-layout

任何人都知道在 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/

相关文章:

android - 如何在 Android 10 (Q) 上直接从外部下载目录读取文件

java - 编写按钮方法时出错

android - Roboguice 在 JUnit 测试中不工作

android - 在 fragment 中调用 acharengine

android - 具有默认值的 EditText

java - 如果连接丢失,Android 会重新连接到蓝牙设备

android - 从 Android 调用 Google Cloud Endpoints API 时出现错误 413(请求实体太大)

android - 抽屉导航 : set as always opened on tablets

android - 如何在android中为多个屏幕实现正确的用户界面

Android 布局——在一个 ListView 行中垂直堆叠两个 TextView