background

Tutorial

Android Custom States for State List

In this tutorial I will show you how to make some custom states which will be used on an ImageButton. Of course, this states could be used for edit text and other too, but in my example I will use ImageButton :) 1. After you create a new project with the main activity called “MyActivity” […]

, , , , ,
Snippets

How to make a background button selector in XML?

Step 1: Create an XML in the drawable folder and name it selected_item.xml (or any another name you want but to be suggestive). The code in this xml will be: <shape android=”http://schemas.android.com/apk/res/android” shape=”rectangle”> <solid color=”#80000000″></solid> </shape> The color=”#80000000″ is transparent black. Step 2: Create an XML again, in the drawable folder an name it not_selected.xml. The code

, , , ,
Scroll to Top