2012-01-12 100 views

回答

3

你可以使用一个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> 

结束语在FrameLayout一切都简单地堆放在SurfaceView的顶视图的一种方式。使用类似的方法来添加取景器。