title: Rotate a SurfaceView in xml layout
body: <p>How can I rotate a custom SurfaceView in a layout file by 180 degrees?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical" 
     android:layout_width="match_parent"
     android:layout_height="match_parent"&gt;
        &lt;package.CustomSurfaceView
          android:layout_width="fill_parent"
          android:layout_height="0dp"
          android:rotation="180"
        /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Needless to say the above code doesn't work.</p>