make autocompletetextview look like edittext

雨燕双飞 提交于 2019-12-24 11:27:37

问题


I am using an AutoCompleteTextView (RobotoAutoCompleteTextView) instead of an EditText. But I want the look and feel of an EditText: i.e. the underline that shows up at the bottom of an EditText. So how might I do that?

My question is a bit incomplete so let me clarify. In the Eclipse Graphical Layout the AutoCompleteTextView looks exactly like the EditText with the underline. But when I run the app in my Samsung Galaxy S5, the underline is gone. Instead I get an ugly box with some "#22000000" background. (Of course I am guessing at the exact hex of the background). So what I need is for the underline to always shows up no matter what device I am using: real phone, or just the Graphical Layout.


回答1:


Try this:

<AutoCompleteTextView
 ...
 style="@style/Base.Widget.AppCompat.EditText" />

or this

<EditText
 ...
 style="@style/Base.Widget.AppCompat.AutoCompleteTextView"/>


来源:https://stackoverflow.com/questions/26220058/make-autocompletetextview-look-like-edittext

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