I would like to extend the UI of AutoCompleteTextView. The Functionality is fine, all I need is to add an button to the right that looks like a drop-down button. Sadly AutoCompleteTextView has a ‘natural’ margin that I can’t reduce to 0.
What can I do now?
Dose I have to overwrite onDraw() & onMeasure() to archive my goal (is there an easier way)?
You could put both
AutoCompleteTextViewand button ontoFrameLayout, add some extra margin right toAutoCompleteTextViewto makeFrameLayoutslightly bigger, and align button to parent right. In fact, these 2 views will interfere, but for user they will appear one next to the other w/o any margin.Another option could be to set custom background to
AutoCompleteTextView(probably modified original one taken from Android source with removed margin).Just remembered that you can supply negative margin. You can put both views onto
LinearLayoutand set left margin of button to-5dpfor example. However, you will still have to supply custom marginless background for button.