【问题标题】:TabWidget not stable at the bottom in Android? Why?TabWidget 在 Android 底部不稳定?为什么?
【发布时间】:2010-06-14 18:06:55
【问题描述】:

我将 tabWidget 设置在底部。当我想编辑edittext时,键盘会抬起。但是选项卡小部件位于键盘上方。为了支持多屏,我设置了 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>

【问题讨论】:

  • Look here 如果你想要 iPhone 这样的标签主机。

标签: android android-layout android-tabs


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-08
    • 2013-10-20
    • 2011-10-12
    • 1970-01-01
    相关资源
    最近更新 更多