I have a rather small but weird problem that I can’t seem to fix.
I am trying to display a image for my button, and it’s showing up as a black square.
The buttons I made before this are showing up and working fine, but this button (and the rest I make afterwards) are showing up as black squares..
Now if I change it to a ImageView instead of a Button, it displays fine.
Has anyone experienced this issue before? If so how did you solve it?
I’m still pretty novice to programming and I’m teaching myself so I really don’t have any help and I’ve been trying to fix it for awhile now. 🙁
Here is the xml for the button/image.
<RelativeLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/pause"
android:src="@drawable/pause"
android:layout_width="29px"
android:layout_height="29px"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="15dp"
android:layout_marginRight="10dp">
</Button>
</RelativeLayout>
If you have any other questions please ask, and thanks a ton for viewing my problem! 🙂
Either use an
ImageButtoninstead ofButtonor changeandroid:src="@drawable/pause"toandroid:background="@drawable/pause"