android xml中tools include的引入
2015-10-19 09:37
337 查看
include的用法:
<?xmlversion="1.0"encoding="utf-8"?> <android.support.design.widget.CoordinatorLayoutxmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <includelayout="@layout/list_map_parkingarea"/> </android.support.design.widget.CoordinatorLayout>
tools的引入:
<?xmlversion="1.0"encoding="utf-8"?>
<android.support.v7.widget.RecyclerViewxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/list_parking_area"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".BaseActivity"
tools:showIn="@layout/activity_parking_area_list"/>
总结:
用<include>可以在xml中引入其他的文件
在xml中用tools:
在container容器中先引入:
xmlns:tools="http://schemas.android.com/tools"
tools:context=".BaseActivity"
tools:showIn="@layout/包含它的布局文件。"
相关文章推荐
- Android开发总结笔记 四大组件之Service(下) 1-2-6
- Android开发总结笔记 四大组件之Service(中) 1-2-5
- Android控件:WebVIew(二)显示网页或本地html文件
- AndroidStudio引入so文件
- singleTask vs singleInstance
- Android 5.0源码分析---智能指针
- 关于Android的gradle的中文编译错误解决办法
- Android 引用library project
- Android TouchEvent事件传递机制
- Android图片加载神器之Fresco-加载图片基础[详细图解Fresco的使用]
- Android开发:shape和selector和layer-list的(详细说明)
- Android Animation --ScaleAnimation
- GenyMotion下载安装过程及遇到的问题
- Android自定义Toast宽度无法设置问题解决
- android 自定义Toast显示风格
- RecyclerView设置Item点击事件
- android 48 广播
- android之Dialog相关
- Android提示版本更新
- android 之杂七杂八