gpt4 book ai didi

android - 如何使用 adjustResize 去除屏幕顶部的白条

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:03:37 24 4
gpt4 key购买 nike

当键盘打开时,屏幕顶部会出现一条白色 strip ,无论键盘状态如何变化,它都会持续存在。

如果我使用 adjustPan 然后它工作,但是,我只想使用 adjustResize

这是问题的图片:


我在 AndroidManifest.xml 中的 Activity 声明

<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="@style/MyTheme"
android:windowSoftInputMode="adjustResize"/>

<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowDrawsSystemBarBackgrounds"
tools:targetApi="lollipop">false</item>
</style>

最佳答案

有一种技术叫做Immersive Full-Screen KitKat 中可用的模式。我认为现在这是实现全屏 Activity 的首选方式。

这是一个 example从文档。

关于android - 如何使用 adjustResize 去除屏幕顶部的白条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39052024/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com