2012-01-12 2 views

答えて

3

あなたはこのようFrameLayoutを使用することができます:FrameLayoutのすべてを包む

<?xml version="1.0" encoding="utf-8"?> 
    <FrameLayout 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent">  

     <android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/preview" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 
     </android.view.SurfaceView> 

      <RelativeLayout android:layout_width="fill_parent" 
      android:layout_height="60dp" 
android:background="#FFFFFF" android:layout_alignParentBottom="true"> 

       <ImageView android:scaleType="centerCrop" android:src="@drawable/some_drawable" android:layout_centerInParent="true" android:clickable="true" 
         android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/my_button"/> 
     </RelativeLayout> 
    </FrameLayout> 

は、単にSurfaceViewの上にビューをスタックする一つの方法です。同様の方法でビューファインダーを追加します。

関連する問題