Tutorial Membuat Layouting Aplikasi
BukuTabungan di Android Studio
- Pertama silahkan klik new project di Android Studio, Nama kan Aplikasi BukuTabungan, Lalu klik NEXT
- Kemudian pilih SDK sesuai dengan Android di Smartphone anda, disini saya memakai Android 4.03(IceCreamSandwidch), lalu klik NEXT
- Setelah itu pilih Activity mobile “Empty Activity” lalu klik NEXT saja
- Lalu langsung klik FINISH jika tidak mau mengganti Activity Name
- Setelah itu, Tunggu hingga proses Grdale selesai dang anti kodingan Relative Layout menjadi Linear Layout seperti ini
- Setelah itu masukan kan gambar img pada layout,dengan perintah image view -> android : src =”drawable/index” ,gambar ya di taro dulu di folder drawable.
- Sebelum memasukan gambar copy gambar kedalam drawable, disini nama gambar yaitu index
- Lalu untuk memasukkan text pada android dengan perintah Text View untu menulis judul app tambahkan kodin gan seperti ini
- Nah lalu kita buat supaya layout kita bisa di scroll dengan perintah scrollview agar aplikasi bisa di scrol,Lalu tambahkan ScrollView agar aplikasi bisa di scroll kebawah ataupun keatas
- Kemudian, Buat kodingan seperti ini untuk mengisi input Form Nama peserta Didik dari Aplikasi, lakukan hal yang sama untuk input lainnya.
- Tambahkan button untuk memproses hasil input
- Untuk menambahkan tulisan seperti note tambahan tambahkan kan kodingan berikut.
1.
Untuk lebih jelasnya berikut seluruh kodingannya
Untuk lebih jelasnya berikut seluruh kodingannya
<?xml version="1.0" encoding="utf-8"?><LinearLayout 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:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#fff" android:orientation="vertical" tools:context="com.example.asus.y.MainActivity"> <ImageView android:layout_width="200dp" android:layout_height="200dp" android:layout_marginLeft="100dp" android:src="@drawable/images" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:text="Buku Tabungan Siswa " android:textColor="#000" android:textSize="30dp" android:textStyle="bold" /> <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="160dp" android:layout_height="wrap_content" android:text="Nama siswa" android:textColor="#000" android:textSize="18dp" /> <TextView android:layout_width="10dp" android:layout_height="wrap_content" android:text=":" android:textColor="#000" android:textSize="18dp" /> <com.rengwuxian.materialedittext.MaterialEditText android:id="@+id/input_nama" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_marginLeft="2dp" android:hint="Nama siswa" android:inputType="textPersonName" android:textSize="16sp" app:met_floatingLabel="highlight" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="160dp" android:layout_height="wrap_content" android:text="Tmp,Tanggal Lahir" android:textColor="#000" android:textSize="18dp" /> <TextView android:layout_width="10dp" android:layout_height="wrap_content" android:text=":" android:textColor="#000" android:textSize="18dp" /> <com.rengwuxian.materialedittext.MaterialEditText android:id="@+id/input_kelas" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Tempat Tanggal Lahir" android:inputType="textPersonName" android:textSize="16sp" app:met_floatingLabel="highlight" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/textView" android:layout_width="160dp" android:layout_height="wrap_content" android:text="NISN/NIPD" android:textColor="#000" android:textSize="18dp" /> <TextView android:layout_width="10dp" android:layout_height="wrap_content" android:text=":" android:textColor="#000" android:textSize="18dp" /> <com.rengwuxian.materialedittext.MaterialEditText android:id="@+id/input_umur" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="nipd / nisn" android:inputType="number" android:textSize="16sp" app:met_floatingLabel="highlight" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="160dp" android:layout_height="wrap_content" android:text="Kelas/Tingkat" android:textColor="#000" android:textSize="18dp" /> <TextView android:layout_width="10dp" android:layout_height="wrap_content" android:text=":" android:textColor="#000" android:textSize="18dp" /> <com.rengwuxian.materialedittext.MaterialEditText android:id="@+id/input_alamat" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="nipd / nisn" android:inputType="number" android:textSize="16sp" app:met_floatingLabel="highlight" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="160dp" android:layout_height="wrap_content" android:text="Tabungan Perhari" android:textColor="#000" android:textSize="18dp" /> <TextView android:layout_width="10dp" android:layout_height="wrap_content" android:text=":" android:textColor="#000" android:textSize="18dp" /> <com.rengwuxian.materialedittext.MaterialEditText android:id="@+id/input_institusi" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Usia" android:inputType="number" android:textSize="16sp" app:met_floatingLabel="highlight" app:met_maxCharacters="2" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="160dp" android:layout_height="wrap_content" android:text="Agama" android:textColor="#000" android:textSize="18dp" /> <TextView android:layout_width="10dp" android:layout_height="wrap_content" android:text=":" android:textColor="#000" android:textSize="18dp" /> <com.rengwuxian.materialedittext.MaterialEditText android:id="@+id/input_agama" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Alamat" android:inputType="text" android:textSize="16sp" app:met_floatingLabel="highlight" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="160dp" android:layout_height="wrap_content" android:text="Nama Orang Tua" android:textColor="#000" android:textSize="18dp" /> <TextView android:layout_width="10dp" android:layout_height="wrap_content" android:text=":" android:textColor="#000" android:textSize="18dp" /> <com.rengwuxian.materialedittext.MaterialEditText android:id="@+id/input_tua" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Asal Institusi" android:inputType="textCapWords" android:textSize="16sp" app:met_floatingLabel="highlight" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="160dp" android:layout_height="wrap_content" android:text="Alamat" android:textColor="#000" android:textSize="18dp" /> <TextView android:layout_width="10dp" android:layout_height="wrap_content" android:text=":" android:textColor="#000" android:textSize="18dp" /> <com.rengwuxian.materialedittext.MaterialEditText android:id="@+id/input_amt" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Wali Kelas" android:inputType="textCapWords" android:textSize="16sp" app:met_floatingLabel="highlight" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="160dp" android:layout_height="wrap_content" android:text="Nama siswa" android:textColor="#000" android:textSize="18dp" /> <TextView android:layout_width="10dp" android:layout_height="wrap_content" android:text=":" android:textColor="#000" android:textSize="18dp" /> <com.rengwuxian.materialedittext.MaterialEditText android:id="@+id/input_guru" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Asal Institusi" android:inputType="textCapWords" android:textSize="16sp" app:met_floatingLabel="highlight" /> </LinearLayout> <Button android:id="@+id/simpan_button" android:layout_width="100dp" android:layout_height="wrap_content" android:onClick="submit" android:text="simpan" android:textAllCaps="true" android:textSize="16sp" /> <Button android:id="@+id/satu" android:layout_width="100dp" android:layout_height="wrap_content" android:onClick="submit" android:text="satu" android:textAllCaps="true" android:textSize="16sp" /> </LinearLayout> <LinearLayout android:layout_width="360dp" android:layout_height="60dp" android:background="#FFE1E1E1"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Teknik Jarigan Komputer,Multimedia,Rekayasa Perangkat Lunak Broacasting,Teknik Informatika." android:textAlignment="center" android:textColor="#000" /> </LinearLayout>
</LinearLayout>
</ScrollView> </LinearLayout>
No comments:
Post a Comment