我有一个简单的android布局和代码,但是AutoCompleteTextView当我点击它时键盘总是重叠.注意:ScrollView内部的AutoCompleteTextView.注意:平台是6.0.1
package com.example.jason_wu.search;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.AutoCompleteTextView;
public class Main2Activity extends AppCompatActivity {
private AutoCompleteTextView mAtv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
mAtv = (AutoCompleteTextView) findViewById(R.id.location_auto_complete);
//issue 1
//mAtv.setBackground(getDrawable(R.drawable.search_input_focus));
//issue 2
mAtv.setHeight(300);
}
}
Run Code Online (Sandbox Code Playgroud)
和我的AndroidManifest.xml在这里:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.jason_wu.search">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="com.example.jason_wu.search.Main2Activity"
android:windowSoftInputMode="adjustPan"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Run Code Online (Sandbox Code Playgroud)
Layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/scrollView" …Run Code Online (Sandbox Code Playgroud) 我想将自动完成下拉框元素大小更改为更小的值.我对textview.settextsize所做的任何更改只会影响字段框中的值,而不会影响下拉框中的值!

我正在动态添加列表项,并且我的适配器已设置为资源
adapterForFromAutoText.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
Run Code Online (Sandbox Code Playgroud)
我应该添加自己的资源来自定义字体的样式,如果是这样,我用它adapterForFromAutoText.add(displayName);来通过适配器动态添加数据.