Reputation: 2165
While taking a course, I was instructed to make an xml selector for a Button. The course said to make a new Android xml in Eclipse, but i am using Android Studio.
Also when I custom write the code it gives me an error. It says "element selector must be declared".
Got code from here: Android: How to Make A Drawable Selector.
Does anyone know how to do this in Android Studio?
Upvotes: 22
Views: 38568
Reputation: 722
First of all, there will be no drawable folder when establish a new Android Project in Android Studio likes Eclipse does. Right click on res folder--> New--> Android Resource Directory--> resource type--> drawable, and now you get a drawable folder, and then, you can add your new drawable resource file, selector, shape and .etc
Upvotes: 4