Android优化-ui优化
来源:互联网 发布:hadoop源码 编辑:程序博客网 时间:2024/05/17 07:47
一、ui优化,去除冗余层级
1、父容器选择,避免多余嵌套。
2、merge、include、viewStub标签使用
1)merge标签中的子集直接加到Activity的FrameLayout跟节点下 (works in this case because the parent of an activity's content view is always a FrameLayout. You could not apply this trick if your layout was using a LinearLayout as its root tag for instance)。如果你所创建的Layout并不是用framLayout作 为根节点(而是应用LinerLayout等定义root标签),就不能应用 merge来优化UI结构。
2)当应用Include或者ViewStub标签从外部导入xml结构时,可以将 被导入的xml用merge作为根节点表示,这样当被嵌入父级结构 中后可以很好的将它所包含的子集融合到父级结构中,而不会出 现冗余的节点。
关于使用<merge />标签的一些限制:
(1)它只能作为XML布局声明的root元素来使用;
(2)使用它来inflate一个布局时,必须指定一个ViewGroup实例作为其父元素并且设置attachToRoot属性为true(参考 inflate(int, android.view.ViewGroup, boolean)
方法的说明 )。
0 0
- Android优化-ui优化
- android优化之UI优化
- Android 性能优化 UI优化
- Android-性能优化-UI优化
- android优化-UI优化总结
- [译]Android UI 优化
- Android UI 优化 1
- Android UI 优化 2
- Android UI 优化3
- Android UI 优化4
- android UI优化
- android UI优化
- Android UI 优化
- Android UI优化
- android ui 优化
- Android优化UI规则
- android UI 的优化
- android UI 优化
- uclinux + nios (UCLinux在NIOS上的移植)
- 3G休眠唤醒问题可能因注册表问题
- Xamarin mono fro android 离线安装破解
- 用enfold主题试做了个网站
- WebServer起不来,如何查看原因
- Android优化-ui优化
- 认识ActiveMQ
- 使用C++的map容器遇到的bug(map/set iterator not dereferencable)
- struts2 注入时不成功
- VS2010下安装和使用boost库
- rcp(插件开发) org.eclipse.ui.actions.ActionGroup 使用
- Hibernate中使用聚集函数查询
- float浮点数的二进制存储方式及转换
- hadoop平台优化综述----转自董的博客