Issue
I am making a music player app. When I try to add an image in the background of the button a white background comes and no image is shown up.
Help me find my error.
<?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"
tools:context=".MainActivity">
<Button
android:id="@+id/button2"
android:layout_width="128dp"
android:layout_height="62dp"
android:background="@drawable/icons8-material-rounded-icons-96" />
</RelativeLayout>
Solution
Name of the image is not right ,when you build this project in gives error so please change image name icons_material_rounded_icons_96 and then it will show background of button.it will work for me.
Answered By - Ashish

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.