首页 > 其他 > 详细

关于res-auto

时间:2015-09-18 18:29:18      阅读:290      评论:0      收藏:0      [点我收藏+]
 
在使用library自定义属性时,命名空间URI需要使用http://schemas.android.com/apk/res-auto,
在编译时,URI会自动替换为当前app的package名。
 
下面是使用support lib 的属性的例子
<android.support.v4.widget.DrawerLayout
    android:id="@+id/dl_main_drawer"
    xmlns: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:fitsSystemWindows="true">

    <!-- 你的内容布局-->
    <include layout="@layout/navigation_content"/>

    <android.support.design.widget.NavigationView
        android:id="@+id/nv_main_navigation"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/navigation_header"
        app:menu="@menu/drawer_view"/>

</android.support.v4.widget.DrawerLayout>

关于res-auto

原文:http://www.cnblogs.com/tonyhan/p/4819772.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!