Fawwaz
Fawwaz

Reputation: 27

imageview not showing image android

this is my xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/delico"
    android:clickable="true"
    tools:backgroundTint="@color/delico"
    tools:context="com.kelompok3.restaurantapp.restoranfixx.LoginScreen">

    <ImageView
        android:id="@+id/imageView5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="45dp"
        android:visibility="visible"
        app:srcCompat="@mipmap/tulis" />

    <ImageButton
        android:id="@+id/btnn_order"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="138dp"
        android:background="@mipmap/orderbtn" />

    <EditText
        android:id="@+id/edt_nMeja"
        android:layout_width="250dp"
        android:layout_height="50dp"
        android:layout_above="@+id/btnn_order"
        android:layout_centerHorizontal="true"
        android:background="@android:color/background_light"
        android:ems="10"
        android:hint="Nomor Meja"
        android:inputType="number"
        android:textColorHint="@color/cardview_dark_background"
        android:visibility="visible"
        tools:layout_editor_absoluteX="85dp"
        tools:layout_editor_absoluteY="282dp" />

    <EditText
        android:id="@+id/edt_nama"
        android:layout_width="250dp"
        android:layout_height="50dp"
        android:layout_above="@+id/edt_nMeja"
        android:layout_alignLeft="@+id/edt_nMeja"
        android:layout_alignStart="@+id/edt_nMeja"
        android:layout_marginBottom="15dp"
        android:background="@color/cardview_light_background"
        android:elevation="1dp"
        android:ems="10"
        android:hint="Nama"
        android:inputType="textPersonName"
        android:textColor="@android:color/black"
        android:textColorHighlight="@android:color/black"
        android:textColorHint="@color/cardview_dark_background"
        android:textColorLink="@android:color/black"
        android:textCursorDrawable="@android:color/black"
        android:visibility="visible"
        tools:layout_editor_absoluteX="85dp"
        tools:layout_editor_absoluteY="216dp" />

</RelativeLayout>

the imageView5 it's not showing up in the emulator but in the preview layout it showing up. i think my code is just fine, i placed the textview at the top so it can't be behind another image. what i am doing wrong?

NOTE: i use transparent image and the size is 19.6kB

Upvotes: 1

Views: 615

Answers (1)

Farido mastr
Farido mastr

Reputation: 504

replace app:src:compat by src as android:src="@mipmap/tulis"

Upvotes: 2

Related Questions