Android xml布局中的视图限制是多少 [英] What is the view limit in Android xml layout

查看:171
本文介绍了Android xml布局中的视图限制是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都对android布局XML有任何想法,可以嵌入XML的最大视图限制是多少?有限制吗?

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?

推荐答案

严格来说,限制"是80.

Strictly speaking the "limit" is 80.

当布局中的视图过多时,Lint报告以下内容:-

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

AndroidLintTooManyViews

AndroidLintTooManyViews

说明

布局有太多视图在一个布局中使用太多视图是不好的 性能.考虑使用复合绘画或其他技巧 减少此布局中的视图数.最大观看次数 默认为80,但可以使用环境变量进行配置 ANDROID_LINT_MAX_VIEW_COUNT.

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.

但是,我使用的表格布局使我的视图数减少了几个(主要是TextViews),而且我没有遇到任何问题.我没有费心去更改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.

这篇关于Android xml布局中的视图限制是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆