它适用于以下代码:
AutoCompleteTextView autoTextView = (AutoCompleteTextView) findViewById(R.id.fillText);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, typeAutoFill);
autoTextView.setAdapter(adapter);
//typeAutoFill is my String array that stores the values which must appear.
但是,建议文本的大小对于我的应用来说太大了。我需要让它们变小。我确实调查了此处发布的类似问题..
我试过:
android:dropDownHeight="" //with different values
这不会产生任何变化。
我还尝试使用仅包含具有我选择的属性的 TextView 的 XML 资源文件跟随 ArrayAdapter:
AutoCompleteTextView autoTextView = (AutoCompleteTextView) findViewById(R.id.fillText);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.auto_fill_item,R.id.autoFillTextView,typeAutoFill);
autoTextView.setAdapter(adapter);
这会导致我的应用崩溃。
真的被这个问题困住了。我尝试了各种选择。有人可以帮忙吗? 提前致谢。
最佳答案
只需将 Textsize=10sp 设置为您的自定义 Textview 或更小
关于android - 我正在尝试在我的 android 应用程序中创建一个 AutoCompleteTextView。问题是,我无法自定义它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31073004/