Android : Android: text button disordered and cut when more than 1 line

on Friday, October 31, 2014


I am having a problem with text in a button. When the text is more than one line, the size of the button is shortened from above and the text does not appear in the center and cut the bottom.


What can be my problem?


enter image description here


xml



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linear_botones"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<Button
android:id="@+id/boton_monumento_1"
android:layout_width="100dp"
android:layout_height="45dp"
android:layout_marginRight="1dp"
style="@style/botonMonumentos" />

<Button
android:id="@+id/boton_monumento_2"
android:layout_width="100dp"
android:layout_height="45dp"
android:layout_marginRight="1dp"
style="@style/botonMonumentos" />

</LinearLayout>


styles



<style name="botonMonumentos">
<item name="android:textSize">13sp</item>
<item name="android:ellipsize">end</item>
<item name="android:gravity">center</item>
<item name="android:maxLines">2</item>
</style>

0 comments:

Post a Comment