Advertisement
safriansah

balokxml

Dec 8th, 2018
5,815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.03 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.    xmlns:app="http://schemas.android.com/apk/res-auto"
  4.    xmlns:tools="http://schemas.android.com/tools"
  5.    android:layout_width="match_parent"
  6.    android:layout_height="match_parent"
  7.    android:orientation="vertical"
  8.    android:layout_margin="12dp"
  9.    tools:context=".MainActivity">
  10.  
  11.     <ImageView
  12.        android:layout_gravity="center"
  13.        android:src="@drawable/balok"
  14.        android:layout_width="128dp"
  15.        android:layout_height="128dp" />
  16.    
  17.     <TextView
  18.        android:text="Panjang :"
  19.        android:layout_width="wrap_content"
  20.        android:layout_height="wrap_content" />
  21.     <EditText
  22.        android:inputType="number"
  23.        android:id="@+id/panjang"
  24.        android:layout_width="match_parent"
  25.        android:layout_height="wrap_content" />
  26.    
  27.     <TextView
  28.        android:text="Lebar :"
  29.        android:layout_width="wrap_content"
  30.        android:layout_height="wrap_content" />
  31.     <EditText
  32.        android:inputType="number"
  33.        android:id="@+id/lebar"
  34.        android:layout_width="match_parent"
  35.        android:layout_height="wrap_content" />
  36.    
  37.     <TextView
  38.        android:text="Tinggi :"
  39.        android:layout_width="wrap_content"
  40.        android:layout_height="wrap_content" />
  41.     <EditText
  42.        android:id="@+id/tinggi"
  43.        android:inputType="number"
  44.        android:layout_width="match_parent"
  45.        android:layout_height="wrap_content" />
  46.  
  47.     <Button
  48.        android:id="@+id/hitung"
  49.        android:text="Hitung"
  50.        android:layout_gravity="center"
  51.        android:layout_width="wrap_content"
  52.        android:layout_height="wrap_content" />
  53.  
  54.     <TextView
  55.        android:id="@+id/hasil"
  56.        tools:text="Hasil"
  57.        android:textSize="24sp"
  58.        android:textStyle="bold"
  59.        android:layout_gravity="center"
  60.        android:layout_width="wrap_content"
  61.        android:layout_height="wrap_content" />
  62.  
  63. </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement