Analysis of Android Development Optimization: detailed explanation of interface UI optimization (2)

If we rewrite the same layout in each XML file, one is code redundancy and poor readability; The other is that it is troublesome to modify, which is very unfavorable to later modification and maintenance. Therefore, generally, we need to write the code with the same layout into a module separately, and then reuse the layout code through the < include / > tag when it is used.

Common, some applications have a title bar at the top. Similar to the following figure.

Example of icon title bar

If the layout of most activities in the project contains such a title bar, you can write the layout of the title bar as a separate XML file.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>