0
카메라의 출력 위에 GLSurfaceView를 배치하고 그 위에 그림을 그립니다. 그런 다음GLSurfaceView는 UI 위젯을 숨 깁니다.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<SurfaceView
android:id="@+id/cameraPreview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<TextView
android:id="@+id/nearest_place_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:textColor="#000"
android:textSize="30sp"
android:text="@string/empty" />
</RelativeLayout>
내가 프로그래밍 GLSurfaceView 추가 :
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bigarrow);
//...
cameraPreview = (SurfaceView) findViewById(R.id.cameraPreview);
mGLView = new MyGLSurfaceView(this);
addContentView(mGLView, new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT));
previewHolder = cameraPreview.getHolder();
previewHolder.addCallback(surfaceCallback);
previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
nearestPubLabel = (TextView) findViewById(R.id.nearest_place_label);
nearestPubLabel.setText(R.string.bigarrow_searching);
nearestPubLabel.setVisibility(View.VISIBLE);//clutching at straws
}
GLSurfaceView 떨어져 화면의 작은 영역에서, 투명, 그리고 내가 볼 수있는 나는 서피스 뷰 SurfaceView와 텍스트 뷰를 포함하는 일반 레이아웃이 그것 밑에 카메라 미리보기. 그러나 내 TextView 표시되지 않습니다. 이 설정을 일반보기로 설정하면 TextView가 표시됩니다.