AutocompleteTextView建议列表上升 [英] AutocompleteTextView suggestion list goes up

查看:136
本文介绍了AutocompleteTextView建议列表上升的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复 安卓!autocompletetextview,建议列表显示TextView的上述

我完全想在键盘显示的建议名单重叠时,建议列表滚动由用户,但它总是打开侧。

I am fully trying to display suggestion list overlapping on keyboard when suggestion list scroll by user but it always open up side.

在这里我得到这样

这是我的清单文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.sl"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".SuggestionListActivity" 
            android:windowSoftInputMode="adjustResize|adjustPan|stateHidden">
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

这是我的main.xml文件

here is my main.xml file

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" android:padding="10dp">

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" 
        android:layout_margin="10dp"/>

    <TextView android:layout_margin="10dp"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="This is testing for the auto complete textview in this application to display suggestion list overlapping on keyboard." />

    <AutoCompleteTextView android:id="@+id/autocomplete"
            android:layout_width="fill_parent" android:layout_margin="5dp"
            android:layout_height="wrap_content" android:hint="Search"
            android:layout_marginLeft="5dp" android:dropDownHeight="300dp"
            android:inputType="textAutoComplete" android:singleLine="true"
            />

</LinearLayout>

做什么,在这个code在键盘上显示的建议时,列表是关注的焦点。

what to do in this code to display the suggestion over keyboard when list was focus.

推荐答案

我以前有这个问题。对于我来说,有上面的 AutocompleteTextView 更多的屏幕空间比低于(测试在一个正常的设备),因此列表向上打开。我调整我的布局略有以便有低于 AutocompleteTextView 更多的空间,并开始开口向下。这就是固定它适合我。

I've had this problem before. For me, there was more screen space above the AutocompleteTextView than below (testing on a "normal" device), so the list opened upwards. I adjusted my layout slightly so that there was more space below the AutocompleteTextView and it started opening downwards. That's what fixed it for me.

这篇关于AutocompleteTextView建议列表上升的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆