Android selectors can be used to give your Buttons or images the feeling that they are being pressed. Essentially, a selector defines a different drawable for different states of an image or Button. Selector files should reside in the /res/drawable/ folder in your project. Here’s what a basic selector looks like:
If this XML resided in /res/drawable/imagebutton_selector, for example you’d set the android:src attribute of your button to android:src=”@drawable/imagebutton_selector”.
Like this:
Like Loading...
Published by Karim Varela
I'm an entrepreneur and blockchain enthusiast, currently cofounder and CTO at Roam, a travel company at the intersection of blockchain. Previously, I built a mobile banking platform as the Vice President of Engineering and managing partner at Beam Financial. I was also part of the engineering teams which built Coffee Meets Bagel, Tinder, and Fandango.
In my spare time, I enjoy salsa dancing, Brazilian jui jitsu, and traveling the world.
View all posts by Karim Varela
You must log in to post a comment.