我在 Android AOSP 项目中使用 TYPE_NAVIGATION_BAR_PANEL 将底部导航栏自定义为左侧导航栏。但问题是它与状态栏重叠。需要将导航栏放在状态栏后面。
我认为这是有意的。StatusBar 的层类型低于导航类型。这意味着导航视图位于 StatusBar 的前面。
/**
* Window type: the status bar. There can be only one status bar
* window; it is placed at the top of the screen, and all other
* windows are shifted down so they are below it.
* In multiuser systems shows on all users' windows.
*/
public static final int TYPE_STATUS_BAR = FIRST_SYSTEM_WINDOW;
.....
/**
* Window type: Navigation bar (when distinct from status bar)
* In multiuser systems shows on all users' windows.
* @hide
*/
public static final int TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19;
作为走动,您可以修改导航栏的布局参数。您可以将 ygetStatusBarHeight()
和重力设置为Gravity.BOTTOM
- 从未测试过。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句