简体   繁体   中英

I can't see my ImageButton on Emulator

This is my error photo

This is my activity_main.xml

<VideoView
    android:layout_alignParentRight="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_alignParentBottom="true"
    android:id="@+id/video_view"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    />

    <RelativeLayout
        android:background="#c64e4e4e"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">

        <ImageButton
            android:id="@+id/imageButton11"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="192dp"
            app:srcCompat="@drawable/play" />
    </RelativeLayout>

</RelativeLayout>

So I can't see my ImageButton on my emulator. And my photo is png but I can see transparent things on android studio, Can anyone help me? Thanks.

Change your ImageButton to:

<ImageButton
        android:id="@+id/imageButton11"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="192dp"
        android:src="@drawable/play" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM