gpt4 book ai didi

android - 为什么键盘出现在 TabBar 之后?

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

在我的应用程序中有 tabBar 和 Edittext。

见下图:

普通屏幕:

enter image description here

按下编辑文本后的图像:

enter image description here

现在为什么这个标签栏会随着键盘一起出现。即使用户通过按下 edittext 打开键盘,我也希望它保持固定在底部。

那我该怎么办呢?

请帮助 e 吗?

TabBarMain Activity 的 xml 布局如下所示:

    <?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>

<LinearLayout
android:id="@+id/LL1"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>

<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
/>

<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="0"/>

</LinearLayout>

</TabHost>

所以请帮助我。

谢谢。

最佳答案

请使用这个

android:windowSoftInputMode="adjustPan"

在你的 Activity 中的 android menifest.xml 文件中。

例子..

<activity
android:name="Youractivity"
android:windowSoftInputMode="adjustPan"/>

关于android - 为什么键盘出现在 TabBar 之后?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9076884/

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