王立平--include在Android中的应用

时间:2014-09-30 11:31:19   收藏:0   阅读:308

一个布局中包含另一个布局

1.在layout下定义activity_other.xml布局

2.代码中的包含如下:



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="${relativePackage}.${activityClass}" > 
    <Button
        android:id="@+id/btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="删除" />


    <include layout="@layout/activity_other" />


</LinearLayout>

原文:http://blog.csdn.net/u013425527/article/details/39692181

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!