What's the purpose of tools:openDrawer=“start” when creating a DrawerLayout (with NavigationView) from the wizard?

前端 未结 2 584
既然无缘
既然无缘 2021-01-07 22:40

Creating an activity with navigation drawer in Android Studio causes this to be shown in the XML code:



        
2条回答
  •  借酒劲吻你
    2021-01-07 23:05

    Android has a dedicated XML namespace intended for tools to be able to record information in XML files, and have that information stripped when the application is packaged such that there is no runtime or download size penalty. The namespace URI is http://schemas.android.com/tools and is usually bound to the tools: prefix:

    This means that tools attribute is used by the IDE and not used in the code functionality.

    I am still trying to find the complete documentation of all tools attributes. I can't find out the openDrawer attribute anywhere. But the following are great documentation on tools:

    http://tools.android.com/tech-docs/tools-attributes
    http://tools.android.com/tips/layout-designtime-attributes


    UPDATE

    Now a complete documentation of all tools attribute is available here.

提交回复
热议问题