Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Android中删除底板碎片中导航栏的间隙/边距_Android_Bottom Sheet - Fatal编程技术网

在Android中删除底板碎片中导航栏的间隙/边距

在Android中删除底板碎片中导航栏的间隙/边距,android,bottom-sheet,Android,Bottom Sheet,我正在使用底部的工作表片段显示一个弹出窗口。 我曾经设置过导航栏的颜色。但是,在一些设备中,导航栏和底部工作表对话框之间存在间隙 我使用了与您相同的堆栈溢出解决方案在导航栏上设置白色背景,遇到了相同的问题 我通过将setWhiteNavigationBarsetLayerSettings metrics.heightPixels字段更新为所需值的一个小负号来解决这个问题,以使底部工作表稍微向下 希望这有帮助 原创 windowBackground.setLayerInsetTop(1, met

我正在使用底部的工作表片段显示一个弹出窗口。 我曾经设置过导航栏的颜色。但是,在一些设备中,导航栏和底部工作表对话框之间存在间隙


我使用了与您相同的堆栈溢出解决方案在导航栏上设置白色背景,遇到了相同的问题

我通过将setWhiteNavigationBarsetLayerSettings metrics.heightPixels字段更新为所需值的一个小负号来解决这个问题,以使底部工作表稍微向下

希望这有帮助


原创

windowBackground.setLayerInsetTop(1, metrics.heightPixels);


修改后的

windowBackground.setLayerInsetTop(1, metrics.heightPixels - 2);