为何要使用<merge\>标签
2012-03-05 14:06
721 查看
在使用include复用layout时,可能复用的layout有个view group,然后这个view group又被嵌套别的view group里,这样就增加了view的深度,影响运行的速度,而这种嵌套不是必须的。
因此可以使用<merge\>标签,它将它里面嵌套的view直接include到其父layout中,而没有再加一层view group,因此减小了深度,提高了速度
merge xmlns:android="http://schemas.android.com/apk/res/android">
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/add"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/delete"/>
</merge>
因此可以使用<merge\>标签,它将它里面嵌套的view直接include到其父layout中,而没有再加一层view group,因此减小了深度,提高了速度
merge xmlns:android="http://schemas.android.com/apk/res/android">
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/add"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/delete"/>
</merge>
相关文章推荐
- Android UI 优化 使用<include/>和 <merge />标签
- Android UI 优化 使用<include/>和 <merge />标签
- android 使用<merge>标签
- Android UI 优化 使用<include/>和 <merge />标签
- 关于spring 3.0.5的<mvc:resources> 标签的使用
- <c:forEach>标签的使用
- struts2 使用<s>标签注意的问题
- <merge>标签
- jsp使用<c:choose>标签来控制内容显示
- 关于spring 3.0.5的<mvc:resources> 标签的使用
- <s:hidden>标签的使用
- <include>标签和BaseActivity联合使用简化代码结构
- Mybatis 使用<where>标签时遇到的一个问题与<trim>标签的使用
- JSP中使用哪个标签允许向<include/>标签传递参数
- <!DOCTYPE> 标签的深度剖析以及使用选择
- JSP中使用哪个标签允许向<include/>标签传递参数
- 为何要使用<merge\>标签
- <welcome-file-list>标签作用,怎样使用
- <merge/>标签在UI界面中的优化作用
- <html:select>,<html:option>,<html:options>,<html:optionsCollection>标签使用