- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 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/
这个问题已经有答案了: EditText, adjustPan, ScrollView issue in android (4 个回答) 已关闭 8 年前。 我将所有布局上的 AdjustPan 设置
ca) 我在其中的 EditText 中有一个 Activity 。如果我直接显示此 Activity ,则在显示软键盘时 adjustPan 工作正常。 b) 如果我在 TabActivity 下显
我在我的应用程序中使用 adjustPan 时遇到了一些问题,因为它没有按预期工作。其他一些用户也遇到了这个问题,所以我认为分享这个问题很重要 (Layout doesn't move up enou
在 list 中使用 adjustPan 将我的布局推到顶部并使我的 UI 看起来很可笑。 这是我的 Android list : 这是我的 XML 文件:
我不是在寻找代码,我也不会发布任何代码,只是一个解释,因为我有点迷路了。 这个主要问题是出现软键盘时调整大小。 以我为例 我有一个 listView,其中包含 2 个 editText 和许多使用自定
我有一个愚蠢的问题,请按照下面的图片 当我点击 Enter Email 时,它如下图所示, 现在,尽管使用了 android:windowSoftInputMode="adjustPan" andro
我的要求是一个完全透明的状态栏,在同一 activity 中动态改变状态栏的颜色。 为此,我添加了 getWindow().addFlags(WindowManager.LayoutParams.FL
我有一个 Activity ,上面有一堆 EditText 字段,并且 windowSoftInputMode 设置为 adjustPan,这主要是我想要的,但是对于布局底部的 editText,它平
在我的应用程序中,我有一个带有页脚的 ListView,该页脚包含一个内部带有 EditText 的自定义 View 。顶部有一个操作栏。 Activity 目前使用SOFT_INPUT_ADJUST
我正在尝试创建一个非常基本的聊天屏幕,其中包含显示文本的 ListView 和底部的 EditText,以及 EditText 右侧的“发送”按钮。一切正常,但是当我单击 EditText 时,虚拟键
我有一个类似下面的布局,当用户点击 EditText 时我希望有以下行为: 键盘应覆盖“LinearLayout 底部对齐”; EditText 应该在屏幕上可见,而不是被键盘覆盖; 工具栏应该在屏幕
考虑以下 View 示例: 并在 list 文件中: android:windowSoftInputMode="adjustPan" onfocus edittext,软键盘像
我正在使用这段代码,但键盘仍然与 EditText 重叠。可以做什么
和很多人一样,我遇到了软输入覆盖我的发送按钮的问题,所以我进行了一些搜索,发现解决这个问题的公认方法是 "android:windowSoftInputMode="stateAlwaysHidden|
在聊天应用程序中,我有一个以图像作为背景的 Activity 。现在,当我输入一条消息以发布手机键盘时,当我在 list 文件中使用 windowSoftInputMode="adjustResize
我知道这里有很多与 Android 中的虚拟键盘相关的内容,但我似乎无法弄清楚如何解决我的问题。 对于那些不熟悉 AdjustPan 和 AdjustResize 的人,您可以在此处查看它们是什么/做
我正在使用谷歌开发人员的这篇文章中的工具栏 (appcompat-v21) 除非我按下我的 editText,否则它工作得很好。我在 list 中设置: android:windowSoftInput
在我的布局中,我在 NestedScrollView 中有一个 EditText。当使用软键盘编辑 EditText 时,我希望向上滚动 NestedScrollView 的内容。但是, Activi
我的 Activity 有一个顶栏和一个底栏。顶栏和底栏之间的空间我有一个线性布局,里面有几个编辑 TextView 。因为我不希望每次出现软键盘时都调整布局大小,所以我在 list 中为我的 Act
我需要将这三个项目都设置为可见 1。 Action 条 2。 ListView 3。 EditText(底部) 当我点击 EditText 时,它会插入背景图像并挤压它。我看到了一些教程并使用 and
我是一名优秀的程序员,十分优秀!