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>
To change the font size of a button, use the font-size property.
Set a padding to the container, it will make it larger depending on how much text is added. For example: padding: 4px 10px; So in your case, remove the width from your <a> selector and add the padding.
display: block and width: 100% is the correct way to go full width but you need to remove the left/right margin on the button as it pushes it outside the containing element. for more information on the box-sizing property, read the MDN docs.
i think you want to align the top of all buttons add this line in your layout
LinearLayout android:baselineAligned="false"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With