Left align text inside a button in Android

android, java, xml

Solution

Maybe this will help you:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <Button
        android:id="@+id/button1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="left|center_vertical"
        android:text="Button" />

</LinearLayout>

Problem

I want to align text of a button to the left, I don't know how to do this, please help me how to do this in the xml file. I didn´t find the properties for this.

Original source