0

我是 Android 新手,我正在设计一个应用程序,但随后出现了此警告消息

activity_main.xml has more than 80 views, bad for performance

我已经在谷歌和这里搜索了它的含义,但每个答案都是针对他们的项目的。我只是想知道您为什么会首先收到此消息,这意味着什么?

4

1 回答 1

2

User interface performance is directly related to (among other things) the complexity of the View hierarchy being displayed. This warning message is simply letting you know that you have a lot of Views defined in this layout and that it could lead to UI performance problems. The solution is to look at your layout and considering how you can simplify the View hierarchy to achieve the desired results with fewer Views. Or, alternatively, you can take this warning with a grain of salt and just test to verify whether performance is acceptable for your layout on the device(s) that you plan to support.

于 2013-10-30T12:09:16.543 回答