软键盘在TabHost中覆盖了一个EditText

4

我知道之前有类似的问题被问过,但我无法解决我的布局问题。

问题: 当往AutoCompleteTextView中添加多行时,键盘会遮挡它。我已经尝试将所有内容包裹在ScrollView中,但没有帮助。 enter image description here 非常感谢您的帮助。

提前致谢。

<?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="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <HorizontalScrollView
            android:id="@+id/tabsScroll"
            android:layout_width="fill_parent"
            android:fadingEdge="horizontal"
            android:fillViewport="true"
            android:layout_height="wrap_content"
            android:scrollbars="@null">
            <TabWidget
                android:id="@android:id/tabs"
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0" />
        </HorizontalScrollView>
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_weight="0" />
        <android.support.v4.view.ViewPager
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />
        <ScrollView
            android:minWidth="25px"
            android:minHeight="25px"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:id="@+id/scrollView1">
            <LinearLayout
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:id="@+id/InputOuterContainer"
                android:layout_alignParentBottom="true">
                <View
                    android:background="#ffcccccc"
                    android:layout_width="fill_parent"
                    android:layout_height="1.0px" />
                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="fill_parent"
                    android:background="#FFFFFF"
                    android:layout_height="wrap_content"
                    android:id="@+id/InputContainer">
                    <AutoCompleteTextView
                        android:id="@+id/InputTextView"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:hint="@string/Ready"
                        android:layout_weight="1.0"
                        android:imeOptions="actionGo"
                        android:inputType="textNoSuggestions"
                        android:selectAllOnFocus="true"
                        android:focusable="true" />
                    <ImageButton
                        android:id="@+id/ButtonRun"
                        android:paddingLeft="16.0dip"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/go"
                        android:scaleType="center"
                        style="?android:attr/borderlessButtonStyle"
                        android:layout_gravity="top" />
                </LinearLayout>
            </LinearLayout>
        </ScrollView>
    </LinearLayout>
</TabHost>

尝试在清单文件中设置android:windowSoftInputMode="adjustPan"属性。 - animaonline
1
它确实起作用了... 但是标签标题现在被隐藏了。 - jjdev80
android:windowSoftInputMode="adjustResize" 这个属性可以帮助您调整界面以适应键盘的启动。 - Swapnil Deshmukh
请粘贴一张屏幕截图... - AVEbrahimi
@MaryJ,你找到解决方案了吗? - Global Warrior
2个回答

2

0
我在ScrollView标签中添加了这行代码:
android:isScrollContainer="false"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接