Layout Dinamis Mengikuti Panjang Layar pada Android

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

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0">

<EditText
android:id="@+id/inputSearch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/search_opt_button"
android:hint="Pencarian bunpo.."
android:inputType="textVisiblePassword" />

<Button
android:id="@+id/search_opt_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="Opsi" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50">

<com.introvesia.nihongonesia.layouts.KanjiCanvas
android:id="@+id/kanji_canvas"
android:layout_width="400dp"
android:layout_height="400dp"
android:layout_weight="50"
android:visibility="gone"></com.introvesia.nihongonesia.layouts.KanjiCanvas>

<Button
android:id="@+id/btn_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="Hapus" />
</RelativeLayout>

<RelativeLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="50"></RelativeLayout>
</LinearLayout>
comments powered by Disqus