Dalam Membua ImageView Kita Perlu Membuat Code Berikut Di File activity_main.xml
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
android:text="REKOMENDASI NOVEL"
android:textAlignment="center"
android:textSize="30dp"
android:background="@color/purple_500"
android:textColor="@color/white"
/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/novel3"
/>
</RelativeLayout>
<RelativeLayout ----->Copy Dari Sini
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="25dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:src="@drawable/bumi1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="BUMI"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_marginLeft="100dp"
android:background="#006400"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="40dp"
android:textColor="#FFFFFF"
android:textSize="15dp"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="110dp"
android:src="@drawable/buku" />
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Pengarang : TERE LIYE"
android:layout_alignParentTop="true"
android:layout_marginLeft="100dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Harga : RP 150.000"
android:layout_alignParentTop="true"
android:layout_marginLeft="100dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Penerbit : TERE LIYE"
android:layout_alignParentTop="true"
android:layout_marginLeft="100dp"/>
</LinearLayout>
</RelativeLayout>---->Sampai Sini
</LinearLayout>
Dan Ini Contoh Hasil Dari Code Diatas
0 Comments:
Posting Komentar