Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 1.68 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. button color doesn't change
  2. <?xml version="1.0" encoding="utf-8"?>
  3. <selector xmlns:android="http://schemas.android.com/apk/res/android">
  4.     <item android:state_pressed="true" >
  5.         <shape>
  6.             <solid
  7.                 android:color="#449def" />
  8.             <stroke
  9.                 android:width="1dp"
  10.                 android:color="#2f6699" />
  11.             <corners
  12.                 android:radius="3dp" />
  13.             <padding
  14.                 android:left="10dp"
  15.                 android:top="10dp"
  16.                 android:right="10dp"
  17.                 android:bottom="10dp" />
  18.         </shape>
  19.     </item>
  20.     <item>
  21.         <shape>
  22.             <gradient
  23.                 android:startColor="#449def"
  24.                 android:endColor="#2f6699"
  25.                 android:angle="270" />
  26.             <stroke
  27.                 android:width="1dp"
  28.                 android:color="#2f6699" />
  29.             <corners
  30.                 android:radius="4dp" />
  31.             <padding
  32.                 android:left="10dp"
  33.                 android:top="10dp"
  34.                 android:right="10dp"
  35.                 android:bottom="10dp" />
  36.         </shape>
  37.     </item>
  38. </selector>
  39.        
  40. <style name="mybuttons">
  41.     <item name="android:layout_width">fill_parent</item>
  42.     <item name="android:layout_height">wrap_content</item>
  43.     <item name="android:textColor">#ffffff</item>
  44. </style>
  45.        
  46. <Button
  47.             android:id="@+id/select_c"
  48.             android:layout_width="fill_parent"
  49.             android:layout_height="wrap_content"
  50.             android:text="@string/choose_c"
  51.  
  52.             android:layout_marginTop="120dip"
  53.             android:background="@drawable/blue_button"
  54.             style="@style/mybuttons"
  55.                 />