TabWidget在Android底层不稳定?为什么?

发布于 2024-09-05 05:46:56 字数 1094 浏览 1 评论 0原文

我将 tabWidget 设置在底部。当我想编辑编辑文本时,键盘会升起。但选项卡小部件位于键盘上方。为了支持多屏幕,我设置了 android:layout_weight="1.0"。之后,我遇到了这个问题,我在下面添加了布局代码。有什么想法可以让 TabWidget 稳定地位于底部吗?

代码:

<?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="fill_parent">
<LinearLayout android:orientation="vertical"
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/tabcontent" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_weight="1.0">

    </FrameLayout>
    <TabWidget android:id="@android:id/tabs"
        android:layout_gravity="bottom" android:background="@drawable/gradient_black"
        android:listSelector="@color/transparent" android:layout_width="fill_parent"
        android:layout_height="63dip" />
</LinearLayout>

I set my tabWidget at the bottom. When i want to edit the edittext the keyboard will raise up. But the tab widget come above the keyboard. To support for the multiple screen i set the android:layout_weight="1.0". After that, I got this problem i added my layout code below. any idea to make the TabWidget at the bottom stably?

Code:

<?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="fill_parent">
<LinearLayout android:orientation="vertical"
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/tabcontent" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_weight="1.0">

    </FrameLayout>
    <TabWidget android:id="@android:id/tabs"
        android:layout_gravity="bottom" android:background="@drawable/gradient_black"
        android:listSelector="@color/transparent" android:layout_width="fill_parent"
        android:layout_height="63dip" />
</LinearLayout>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无名指的心愿 2024-09-12 05:46:56

您可能需要调整清单中的 windowSoftInputMode 。这控制显示软键盘时屏幕如何移动。也许您想要使用AdjustPan 而不是默认的adjustResize?此页面提供了有关各种输入模式的更多信息。

You may want to adjust the windowSoftInputMode in your manifest. This controls how the screen shifts when the soft keyboard is shown. Perhaps you want to AdjustPan instead of the default adjustResize? This page has more info on the various input modes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文