RT。我要做的应用,调用相机的时候,需要在预览界面上面增加一个按钮(或者叠加显示另一个图片)。请问有人做过吗。

解决方案 »

  1.   

    可以的,使用RelativeLayout<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <SurfaceView android:id="@+id/preview"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:layout_centerInParent="true" />
    <ImageButton
    android:id="@+id/flash" android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true" android:layout_alignParentRight="true"
    android:scaleType="center" android:visibility="visible"
    ></ImageButton>
    </RelativeLayout>