Where Should I put the PNG file relate to ImageButton in Android?
I'm very new to Android.
I created a ImageButton. The main.xml includes code segment as following.
<ImageButton
android:id="@+id/button1"
android:layout_width="50px"
android:layout_height="50px"
android:src="@drawable/cat"
android:layout_x="50p开发者_Python百科x"
android:layout_y="52px"
>
Where do i have to put the "cat.png" i have. Do i need to rename it to something else?
Put it in the res/drawable/
folder in your Android project. Keep the name cat.png
you can simply put in any one folder it will work no need to change xml for that.
精彩评论