I have two button
in my layout inside my TableLayout
, but the text is not in center, I try to use android:gravity="center"
and android android:layout_gravity="center"
, but seems it doesn't work.
How can i fix this? thanks in advance
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:id="@+id/bawah"
android:layout_margin="10dp"
android:layout_alignParentBottom="true"
>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="10">
<Button
android:layout_width="0dip"
android:layout_height="wrap_content"
android:text="Approve"
android:textColor="@color/putih"
android:textAlignment="center"
android:layout_gravity="center"
android:gravity="center"
android:layout_weight="4.9"
android:id="@+id/approve"
android:background="@drawable/backhijau"
/>
<TextView android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="0.2"/>
<Button
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="4.9"
android:textAlignment="center"
android:text="Tolak"
android:layout_gravity="center"
android:gravity="center"
android:textColor="@color/putih"
android:id="@+id/tolak"
android:background="@drawable/backmerah"
/>
</TableRow>
</TableLayout>
</RelativeLayout>