0

enter image description here

The two buttons in the bottom of the screen are Scan and Leads, if we click on any button, the view of the button is visible like pressed as u see in image for lead button, this view will change according to the button click, and here i am unable to create that kind of look and feel for buttons. please provide me the sample code or suggest me to achieve this look and feel.

Thanking you

Blundell
  • 75,855
  • 30
  • 208
  • 233
  • This is a Gradient applied to that button as background Drawable at 2 states.Seleted and non selected. Look here http://stackoverflow.com/questions/7419539/background-gradient – weakwire Apr 04 '12 at 11:27
  • see http://stackoverflow.com/questions/1521640/standard-android-button-with-a-different-color – ngesh Apr 04 '12 at 11:29

2 Answers2

0
<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/button_some_name_pressed" android:state_pressed="true"/>
    <item android:drawable="@drawable/button_some_name_default"/>

</selector>

Have this in your /drawable/ folder as button_some_name.xml

Then have the button_some_name_pressed.png & button_some_name_pressed.png in your drawable-ldpi drawable-mdpi etc

There are other states to consider as well

ref: http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList

Blundell
  • 75,855
  • 30
  • 208
  • 233
0

this is custom button .A custom button is very easy to create, you just have to make different images for the different state of the button and place it into your res/drawable folder. below link contain the step by step description for creating this:

http://androidemulator.wordpress.com/2011/11/03/creating-custom-buttons-in-android-applications/

Nibha Jain
  • 7,742
  • 11
  • 47
  • 71