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

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 1.53 KB  |  hits: 19  |  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. Is it possible to rotate a drawable in the xml description?
  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.           android:drawable="@drawable/and_card_details_button_down_left_onclick" /> <!-- pressed -->
  6.     <item android:drawable="@drawable/and_card_details_button_down_left" /> <!-- default -->
  7. </selector>
  8.        
  9. <Button android:id="@+id/Details_Buttons_Top_Left_Button"
  10.         android:layout_width="fill_parent"
  11.         android:layout_height="fill_parent"
  12.         android:background="@drawable/details_menu_large_button" />
  13.        
  14. <?xml version="1.0" encoding="utf-8"?>
  15. <selector xmlns:android="http://schemas.android.com/apk/res/android">
  16.  
  17.     <item android:state_pressed="true">
  18.         <rotate
  19.         android:fromDegrees="90"
  20.         android:toDegrees="90"
  21.         android:pivotX="50%"
  22.         android:pivotY="50%"
  23.         android:drawable="@drawable/and_card_details_button_up_onclick"/>
  24.     </item>
  25.  
  26.     <item>
  27.         <rotate
  28.         android:fromDegrees="90"
  29.         android:toDegrees="90"
  30.         android:pivotX="50%"
  31.         android:pivotY="50%"
  32.         android:drawable="@drawable/and_card_details_button_up_onclick"/>
  33.     </item>
  34.  
  35. </selector>
  36.        
  37. <?xml version="1.0" encoding="utf-8"?>
  38. <rotate xmlns:android="http://schemas.android.com/apk/res/android"
  39.         android:fromDegrees="90"
  40.         android:toDegrees="90"
  41.         android:pivotX="50%"
  42.         android:pivotY="50%"
  43.         android:drawable="@drawable/mainmenu_background">
  44. </rotate>