打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
android界面xml文件中导入另一个xml文件的方法include

<RelativeLayout
          android:layout_width="60px"
          android:layout_height="fill_parent"
          android:layout_marginLeft="420px">
          <include android:id="@+id/included1"
              layout="@layout/anotherlayout" />

    </RelativeLayout>

 

或通过merge 引入

<LinearLayout 
   android:layout_width="100px"
   android:layout_height="wrap_content">
  <include layout="@layout/anotherlayout"/>
  </LinearLayout>

 

<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
  <Button android:id = "@+id/btn"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="按钮"/>
</merge>

 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
【转】<viewStub />, <requestFocus />, <merge /> and <include />
android中include标签的使用
Android里merge和include标签的使用
Android布局整合include界面控件(重用布局)
xml中,button改变背景颜色方法
Android UI学习 - FrameLayou和布局优化
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服