5

In my android app I have a Button for voting photos. When the user select this Button, the text on this Button became "Thanks for your vote" and when he see a photo that he voted before, on Button will see the text "you have already vote for this photo"...the problem is that it looks like this : http://i55.tinypic.com/t4z3vl.png

Can anyone help me hot can I fit the text on Button?

Any idea is welcome. Thanks in advance.

In xml I have this :

<LinearLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_below="@id/imagetitle"
        android:orientation="horizontal">
        <Button android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Previous" android:id="@+id/previous" />
        <Button android:layout_width="185dip" android:layout_height="wrap_content"
            android:text="Vote for this picture" android:id="@+id/vote" />
        <Button android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:text="Next" android:id="@+id/next" />
    </LinearLayout>
Tetsujin no Oni
  • 7,300
  • 2
  • 29
  • 46
Gabrielle
  • 4,933
  • 13
  • 62
  • 122

3 Answers3

6

i think you want to align the top of all buttons add this line in your layout

LinearLayout android:baselineAligned="false"
Avi Kumar
  • 4,403
  • 8
  • 36
  • 67
3

Use "wrap_content" for the layout_height property of the Button

Arnab Chakraborty
  • 7,442
  • 9
  • 46
  • 69
1

Hi take a look at these http://developer.android.com/guide/practices/screens_support.html maybe if you have deferent styles for each screen it will solve your problem. :D

PedroAGSantos
  • 2,336
  • 2
  • 17
  • 34