To use a DrawerLayout, position your primary content view as the first child with a width and height of match_parent. Add drawers as child views after the main content view and set the layout_gravity appropriately. Drawers commonly use match_parent for height with a fixed width
要使用DrawerLayout,请将主要内容视图定位为宽度和高度为match_parent的第一个子视图。 在主内容视图后添加抽屉作为子视图,并相应地设置layout_gravity。 抽屉通常使用match_parent作为具有固定宽度的高度

本文介绍如何使用Android的DrawerLayout组件来创建侧滑菜单。主要内容包括:将主要内容视图定位为宽度和高度为match_parent的第一个子视图;在主内容视图后添加抽屉作为子视图并设置layout_gravity;抽屉通常使用match_parent作为高度,具有固定宽度。注意侧滑菜单布局应在主内容布局之后,以确保点击事件有效。

2045

被折叠的 条评论
为什么被折叠?



