解决方案 »

  1.   

    布局代码是:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >    <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" >        <SurfaceView
                android:id="@+id/previewSV"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </FrameLayout>
        <com.cn.view.DrawImageView
                android:id="@+id/drawIV"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />    <ImageButton
            android:id="@+id/btn_shutter"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="10dip"
            android:background="@drawable/photo_img_btn" /></RelativeLayout>
      

  2.   

    调用代码是:package com.cn.activity;
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.view.View.OnClickListener;import com.cn.PlayCamera.R;
    import com.cn.view.MyImageView;
    public class RolateAnimActivity extends Activity {

    //获取拍摄按钮
    private MyImageView screen;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.rolate_main);

    //获取拍摄按钮组件
    screen = (MyImageView) findViewById(R.id.screen);

    //定义拍摄按钮点击事件
    screen.setOnClickListener(new ScreenListeren());

    }

    private class ScreenListeren implements OnClickListener{ @Override
    public void onClick(View v) { Intent intent = new Intent(RolateAnimActivity.this ,  RectPhotoActivity.class);
    startActivity(intent);

    }

    }

    }
      

  3.   

    Intent intent = new Intent(RolateAnimActivity.this ,  RectPhotoActivity.class);跳转后的活动要合对应的布局联系在一起,你直接跳转至照相机可能就看不到预览的xml了