I am creating an app which have an ImageButton in the Center. The problem is that I am not getting a transparent image inside the imagebutton even the image is in pure PNG format.
My Xml is as follows
<?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"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="switchmode.lteonly.lteonlyswitch.MainActivity"
tools:showIn="@layout/app_bar_main">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButton"
android:clickable="true"
android:layout_centerVertical="true"
android:layout_centerInParent="true"
android:src="@drawable/myimage"
android:onClick="onClick"/>
</RelativeLayout>
The output Layoutis as follows.
Any Idea how to resolve this??