我应该使用Java或XML为Android的布局? [英] Should I use Java or XML for Android layouts?

查看:144
本文介绍了我应该使用Java或XML为Android的布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有使用Java XML相比做在Android中布局之间的最佳实践或显着的区别在性能上?

Is there a "best practice" or noticeable difference in performance between using Java to do layouts in Android over XML?

有关它的缘故,假定我们只是摆出它采用多重活动相对简单的用户界面。

For the sake of it, assume we are just laying out a relatively simple UI which uses multiple activities.

推荐答案

XML布局的优点是更好的是,他们允许定义的多个布局小code

An advantage of XML layouts are better is that they permit to define multiple layouts with smaller code

多语言应用U可以定义法语和英语的用户界面和加载应用程序启动时所需的一种

for multi-language application u can define French and english UI and load the desired one at application startup

他们允许支持多种屏幕分辨率和方向(定义为每个配置文件main.xml中)

they permit to support many screen resolutions and orientation (define main.xml file for each profile)

也ü可以轻松地添加和修改布局不接触u'r code

also u can easily add and modify layout without touching u'r code

所以,最好的使用它

这篇关于我应该使用Java或XML为Android的布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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