gpt4 book ai didi

android:使用adjustPan并且不滚动标题栏

转载 作者:行者123 更新时间:2023-12-05 00:08:30 25 4
gpt4 key购买 nike

我正在使用 android:windowSoftInputMode="adjustPan"在我的manifest.xml .
它让我的工作做得很好,但它有些迟钝。
当我聚焦 EditText即在屏幕的下半部分,标题栏也随着 Activity 的内容滚动。

image here

我想要的只是在滚动内容时卡住/ float 标题栏。像这样:

image here

不,我不想使用 adjustResize它在彼此之上重叠 View

非常感谢任何帮助,长期以来一直在寻找答案。

最佳答案

找到了!

只需将布局 xml 文件中的 Root View 更改为 ScrollView做这项工作。

我什至不需要指定 android:windowSoftInputMode
当然,作为 ScrollView 的子项,我必须将其他所有内容都放在一个布局中。

编辑

您的 .xml 文件应如下所示:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
... >
<LinearLayout> // could be any other layout but linear works well here
//insert all other views of the activity here
</LinearLayout>
</ScrollView>

关于android:使用adjustPan并且不滚动标题栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22589216/

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