ZRE0412

fruit-xml

Sep 16th, 2021 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.65 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <androidx.constraintlayout.widget.ConstraintLayout 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.    tools:context=".MainActivity">
  8.  
  9.     <ImageView
  10.        android:id="@+id/imageView"
  11.        android:layout_width="407dp"
  12.        android:layout_height="120dp"
  13.        android:layout_marginTop="4dp"
  14.        app:layout_constraintEnd_toEndOf="parent"
  15.        app:layout_constraintStart_toStartOf="parent"
  16.        app:layout_constraintTop_toTopOf="parent"
  17.        app:srcCompat="@drawable/banner" />
  18.  
  19.     <TextView
  20.        android:id="@+id/textView"
  21.        android:layout_width="wrap_content"
  22.        android:layout_height="wrap_content"
  23.        android:layout_marginTop="24dp"
  24.        android:text="請點選下列水果圖示"
  25.        android:textSize="34sp"
  26.        app:layout_constraintLeft_toLeftOf="parent"
  27.        app:layout_constraintRight_toRightOf="parent"
  28.        app:layout_constraintTop_toBottomOf="@+id/imageView" />
  29.  
  30.     <TableLayout
  31.        android:id="@+id/tableLayout"
  32.        android:layout_width="wrap_content"
  33.        android:layout_height="wrap_content"
  34.        android:layout_marginTop="80dp"
  35.        app:layout_constraintEnd_toEndOf="parent"
  36.        app:layout_constraintStart_toStartOf="parent"
  37.        app:layout_constraintTop_toBottomOf="@+id/textView">
  38.  
  39.         <TableRow
  40.            android:layout_width="match_parent"
  41.            android:layout_height="match_parent"
  42.            android:layout_gravity="center">
  43.  
  44.             <ImageView
  45.                android:id="@+id/apple"
  46.                android:layout_width="120dp"
  47.                android:layout_height="match_parent"
  48.                app:srcCompat="@drawable/apple" />
  49.  
  50.             <ImageView
  51.                android:id="@+id/lemon"
  52.                android:layout_width="120dp"
  53.                android:layout_height="match_parent"
  54.                app:srcCompat="@drawable/lemon" />
  55.  
  56.             <ImageView
  57.                android:id="@+id/orange"
  58.                android:layout_width="120dp"
  59.                android:layout_height="120dp"
  60.                app:srcCompat="@drawable/orange" />
  61.  
  62.         </TableRow>
  63.  
  64.         <TableRow
  65.            android:layout_width="match_parent"
  66.            android:layout_height="match_parent">
  67.  
  68.             <ImageView
  69.                android:id="@+id/pumpkin"
  70.                android:layout_width="120dp"
  71.                android:layout_height="match_parent"
  72.                app:srcCompat="@drawable/pumpkin" />
  73.  
  74.             <ImageView
  75.                android:id="@+id/tomato"
  76.                android:layout_width="120dp"
  77.                android:layout_height="match_parent"
  78.                app:srcCompat="@drawable/tomato" />
  79.  
  80.             <ImageView
  81.                android:id="@+id/banana"
  82.                android:layout_width="120dp"
  83.                android:layout_height="120dp"
  84.                app:srcCompat="@drawable/banana" />
  85.         </TableRow>
  86.  
  87.     </TableLayout>
  88.  
  89.     <TextView
  90.        android:id="@+id/Show"
  91.        android:layout_width="wrap_content"
  92.        android:layout_height="wrap_content"
  93.        android:layout_marginStart="108dp"
  94.        android:layout_marginEnd="108dp"
  95.        android:layout_marginBottom="100dp"
  96.        android:textSize="48sp"
  97.        app:layout_constraintBottom_toBottomOf="parent"
  98.        app:layout_constraintEnd_toEndOf="parent"
  99.        app:layout_constraintStart_toStartOf="parent" />
  100.  
  101. </androidx.constraintlayout.widget.ConstraintLayout>
Add Comment
Please, Sign In to add comment