TabWidget在Android底层不稳定?为什么?
我将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要调整清单中的 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.