GUI Layout

Untuk Mengatur Layout Maka Buatlah Code Berikut Di File                                                 activity_main.xml 

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">


<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="365dp"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="belajar"
android:textSize="50dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="coba"
android:textSize="50dp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="belajar"
android:textSize="50dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="belajar"
android:textSize="50dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="belajar"
android:textSize="50dp"/>


</LinearLayout>

<RelativeLayout
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="365dp"
app:layout_constraintTop_toTopOf="parent">


<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="simpan" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="rubah" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="save" />


<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="back" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test"
android:textSize="30dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
/>


</RelativeLayout>


</androidx.constraintlayout.widget.ConstraintLayout>

        Dan Ini Hasil Dari Codingan Diatas


0 Comments:

Posting Komentar