4
我创建了一个简单的AutoCompleteTextView这样的:“机器人:dropDownAnchor”不工作在Android牛轧糖(API 24)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<AutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/query"
android:dropDownAnchor="@id/dropdownDivider"
android:dropDownWidth="match_parent"
android:dropDownHeight="match_parent"
android:inputType="text"
android:android:imeOptions="actionSearch"/>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#ccc"
android:id="@+id/dropdownDivider"/>
</LinearLayout>
下拉应该来的autocompletetextview和所谓的“dropdownDivider”的观点如下。它不应该与autocompletetextview重叠。这是通过使用android:dropDownAnchor
属性实现的。这在API版本低于23的情况下完美运行。
但是,在API 24(Android Nougat)中,下拉列表与autocompletetextview重叠并占用全屏。
我试了一下:
- 与
<android.support.v7.widget.AppCompatAutoCompleteTextView/>
替换<AutoCompleteTextView/>
但 没有帮助。 - 尝试this,this,this和几个更多的答案,但 没有解决问题。
任何想法?
我也在android 7.0上有我的autocompletetextviews的不同行为,通常点击时,用户界面会将点击的视图滚动到屏幕顶部,然后下降到视图下方,但现在看起来像下拉菜单刚刚出现在视图的顶部,UI不会自动滚动 – buradd