1

I am trying to display a table of 4 players. I have a table drawable and a chair drawable. I want to use chair drawable four times around the table with different orientations. Is it possible?

I don't want to use four different drawables (chair_north, chair_east, chair_south, chair_west) to draw the chairs around the table. This will increase the size of the application.

EDIT: Can I do this with just resources xml files? (without any java code)

Cœur
  • 34,719
  • 24
  • 185
  • 251
ilkinulas
  • 3,365
  • 3
  • 21
  • 27

1 Answers1

2

For API 11 and up you can use something like

    <ImageView
        android:id="@+id/imageViewArrowUp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/arrow"
        android:rotation="-90" />

to rotate the view -90 degrees. Depending on what you have in your drawable you can rotate the view to the other 3 orientations.

Diego Torres Milano
  • 61,192
  • 8
  • 106
  • 129