其他分享
首页 > 其他分享> > TabWidget在Android底部不稳定吗?为什么?

TabWidget在Android底部不稳定吗?为什么?

作者:互联网

我将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>

解决方法:

您可能需要在清单中调整windowSoftInputMode.控制显示软键盘时屏幕的移动方式.也许您想使用AdjustPan而不是默认的AdjustResize? page包含有关各种输入模式的更多信息.

标签:android-layout,android,android-tabs
来源: https://codeday.me/bug/20191106/1999439.html