java - Android - 向下滑动关闭活动时,Slidr 插件奇怪的边距
问题描述
我正在使用这个插件:
https://github.com/r0adkll/Slidr
当我向下滑动以关闭活动时,当我向下滑动时,活动上方有一个奇怪的边距:
内部活动:
val config = SlidrConfig.Builder()
.position(SlidrPosition.TOP)
.build();
Slidr.attach(this, config)
活动 xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:background="@color/colorPrimary">
和风格:
<style name="slider" parent="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="listPreferredItemHeightSmall">56dp</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
解决方案
添加<item name="android:fitsSystemWindows">true</item>
到主题样式解决了这个问题
推荐阅读
- java - 如何从包含构造函数的类中调用方法?
- android - 关于 handler.java 中“android.annotation.NonNull”的 android studio 错误
- python - Python C API:如何在不知道其类型的情况下将任何 Python 对象存储为 void*?
- r - R:将“vline”和“hline”语句组合在一起(ggplot2)
- python - 如何编写在以太网接口上运行的客户端/服务器程序?
- swift - 如果使用编辑器中的场景加载,如何在 SpriteKit 中检测触摸
- javascript - Mac Underscan 调整编码问题 - AppleScript
- python - 如何在 Pandas 的列中重新编码值?(我这样做的尝试不起作用)
- c# - 如何通过 Moq 在 .NetCore Unit Tesing 中验证 ILogger?
- github - 通过 Github API 添加标签时不可见