0

I am trying to achieve exactly something like this

alt text - a text view on left and a button to its right - Button should be wrap_text - textedit should occupy the remaining space

If you carefully see the image in the image the buttons left curved border are hiding under the text view.

I am using relative layout to adjust the button height according to this

How to get a button's height to match another element's height?

But I am unable to hide the left portion of the button.

Community
  • 1
  • 1
Gaurav Shah
  • 5,223
  • 7
  • 43
  • 71

2 Answers2

2

Actually the Button isn't hidden under the EditText.

They used custom background for that button, which is 9 patch png image. You can achieve this by providing your 9 patch images for both EditText and Button with 0 margin between them.

Here is a nice tutorial about using 9 patch png.

Another post to consider is Buttons with (niceley) stretched background.

Adil Soomro
  • 37,609
  • 9
  • 103
  • 153
  • I know I can use 9 patch image . But I have my other buttons of the same background which are full ( not hidden) . So just for one button creating another 9patch image is overwork . simple solution would be to slide the button below the `edittext` – Gaurav Shah Apr 09 '12 at 08:56
0

add android:layout_marginLeft="-10dp" to the button

MaciejGórski
  • 22,187
  • 7
  • 70
  • 94