Android autocompletetextview dropdown box's elements have a large font

人走茶凉 提交于 2019-12-06 03:19:23

问题


I would like to change the autocomplete dropdown boxes element size to something smaller. Any change i do with textview.settextsize affects only the value in the fieldbox and not in the drop down box!

I am adding the list items dynamically and my adapter is set to the resource

adapterForFromAutoText.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);

Should i add my own resource to customize the style of the font, if so does it matter that i use adapterForFromAutoText.add(displayName); to dynamically add data through the adapter.


回答1:


Do you have the attribute "android:textSize" within your "android.R.layout.simple_dropdown_item_1line"? You may want to try to change the textSize there.

You may also want to check out this tutorial.




回答2:


Use This Layout , It will change the autocomplete dropdown boxes element size to smaller

ArrayAdapter<String> adapter = new ArrayAdapter<String>(
            this, android.R.layout.simple_spinner_item, aList);


来源:https://stackoverflow.com/questions/5697850/android-autocompletetextview-dropdown-boxs-elements-have-a-large-font

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!