Animation Scaling for SurfaceView

I am trying to create a SurfaceView that scales using animation (including black canvas). I am looking for several ways, but it seems that the view does not scale correctly or does not scale at all.

this is the layout:

<LinearLayout>
         <RelativeLayout
             android:id="@+id/gfxComponentContainer"
             android:layout_width="292dp"
             android:layout_height="260dp"
             android:background="@color/black" 
             android:gravity="center_horizontal">

             <SurfaceView
                  android:id="@+id/gfxComponent"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
              />
          </RelativeLayout>
</LinearLayout>

Any help would be appreciated!

+3
source share
1 answer

SurfaceHolder.setSizeFromLayout () may be what you (were) looking for. http://developer.android.com/reference/android/view/SurfaceHolder.html#setSizeFromLayout ()

0
source

All Articles