Thursday, December 9, 2021

Equal size in xml

1.  Fix equal size or equal width in xml

android:layout_weight="1"

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context=".MainActivity">

<Button
android:id="@+id/idBtnPost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="Save"
android:layout_weight="1"
android:textAllCaps="false" />
<Button
android:id="@+id/btn_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="Go Back"
android:layout_weight="1"
android:textAllCaps="false" />
</LinearLayout>

No comments:

Post a Comment

Date format in android

public String f_dateFormat (String cdate , String dateToFormat) { // String cdate = "2013-05-15T10:00:00-0700"; ...