本文介绍了在键盘隐藏的android autocompletetextview暗示的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有3个 autocompletetextview
的我在其中设置它的适配器是一个 ArrayAdapter<字符串>
带很简单的的TextView
的布局。
在 autocompletextview
提示结果显示,但屏幕上的键盘下(我可以看到它的一部分)。我怎么可以使结果表明上方的 autocompletetextview
,而不是下面?
航空公司=(AutoCompleteTextView)findViewById(R.id.airline);
airline.setAdapter(新ArrayAdapter<字符串>(这一点,R.layout.autcomplete_dropdown,AIRLINES_AUTOCOMPLETE_ARRAY));
departLocation =(AutoCompleteTextView)findViewById(R.id.departLocation);
departLocation.setAdapter(新ArrayAdapter<字符串>(这一点,R.layout.autcomplete_dropdown,LOCATIONS_AUTOCOMPLETE_ARRAY));
arriveLocation =(AutoCompleteTextView)findViewById(R.id.arriveLocation);
arriveLocation.setAdapter(新ArrayAdapter<字符串>(这一点,R.layout.autcomplete_dropdown,LOCATIONS_AUTOCOMPLETE_ARRAY));
解决方案
使用滚动型的布局,你的自动完成所在瞧!
I have 3 autocompletetextview
's in which i set its adapter to be an ArrayAdapter<String>
with a very simple textview
layout.
The autocompletextview
hint results are showing, but are under the onscreen keyboard(i can see part of it). how can i make the results show above the autocompletetextview
rather than below?
airline = (AutoCompleteTextView)findViewById(R.id.airline);
airline.setAdapter(new ArrayAdapter<String>(this, R.layout.autcomplete_dropdown, AIRLINES_AUTOCOMPLETE_ARRAY));
departLocation = (AutoCompleteTextView)findViewById(R.id.departLocation);
departLocation.setAdapter(new ArrayAdapter<String>(this, R.layout.autcomplete_dropdown, LOCATIONS_AUTOCOMPLETE_ARRAY));
arriveLocation = (AutoCompleteTextView)findViewById(R.id.arriveLocation);
arriveLocation.setAdapter(new ArrayAdapter<String>(this, R.layout.autcomplete_dropdown, LOCATIONS_AUTOCOMPLETE_ARRAY));
解决方案
Use a ScrollView for the layout where your Autocomplete resides and Voila!
这篇关于在键盘隐藏的android autocompletetextview暗示的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!