I have three image for Button
, using png format.
I have made a Selector
as below:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- pressed -->
<item android:state_pressed="true" android:drawable="@drawable/press_pdgmap" />
<!-- hover -->
<item android:state_focused="true" android:drawable="@drawable/hover_pdgmap2" />
<!-- default -->
<item android:drawable="@drawable/hover_pdgmap" />
</selector>
But red tag appear in line pressed, hover, and default, it says
Top level element is not completed, Valid XML document must have a root tag
note: I'm using Android Studio
Top level element should be
selector
and XML file should be placed in the res/drawable/ directory. Example: