Create your account

Already have an account? Login here

Note: By joining, you will receive periodic emails from Coursetro. You can unsubscribe from these emails.

Create account

43. Add a Selector to the Button

Design + Code an Android App from Scratch

Woah, wait a second..

Scrounge up some loose change to become a pro member, or login to your account to view this lesson.

Alright, join now. Or login to your account if you're already a pro member.

This video shows how to make a selector in Android. A selector is basically a collection of drawables where each drawable is displayed when the widget using the selector is in a particular state and as a developer you have to specify which states of the selector correspond to which drawables. When the button is pressed, it selects the first colour in our case and when the button is not pressed, it selects the second colour from the selector for our Button when we apply a selector to the text colour of our Button. Instead of using images as selector items, we can also use shapes like rectangle where we specify the solid colour and the stroke colour that must be applied at each state of the selector.

Course Cirriculum