Roland
Roland

Reputation: 876

How to put a vertical line inside a EditText?

I have a edit text and I want to out a line and the buttons like this: enter image description here

I want to put he buttons too. If anyone know how to do this I appreciate the help. How to put the line and how to avoid the text to cross the line?

Upvotes: 0

Views: 616

Answers (3)

Roland
Roland

Reputation: 876

Thank you for all the answers. I did It. I added a imageview on the EditText. Then I added a padding right on the edittext to the text not to cross the line. One more time, Thank you very much for all the answers.

Upvotes: 0

ankitjaininfo
ankitjaininfo

Reputation: 12372

As pointed by Collin, this is a compound view. All those buttons are not inside text box. You can consider a LinerLayout using horizontal orientation. Here goes the layout hierarchy:

LinearLayout  (horizontal orientation)
|
+- EditText (fill parent)
|
+- LinearLayout (vertical orientation, width-30dp, gravity-right)
   |
   +- TextView (show remaining chars)
   | 
   +- Button
   | 
   +- Button

Note: I am giving just an idea how you can layout views to achieve said goal. You might need to tweak a little.

Upvotes: 0

Collin Flynn
Collin Flynn

Reputation: 771

What you actually want is a compound layout of your own construction. Something like:

red boxes are view children

One top level linear layout with the text view, a line drawable, and another LinearLayout which holds (vertically) the '160/1', the clip button, and the 'Enviar' button.

Upvotes: 1

Related Questions