How to place text on a button?

In my Android app, I have a button for voting photos. When the user selects this button, the text on this button becomes “Thank you for your vote”, and when he sees the photo that he voted before, the text “you already voted for this photo” will appear on Button ... the problem is that it looks like this : http://i55.tinypic.com/t4z3vl.png

Can someone help me, can I pick up the text on the 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> 
+4
source share
3 answers

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

 LinearLayout android:baselineAligned="false" 
+5
source

Use "wrap_content" for the layout_height property for Button

+3
source

Hi, check out http://developer.android.com/guide/practices/screens_support.html , maybe if you have styles for each screen, this will solve your problem .: D

+1
source

All Articles