在 javacameraview 前面添加按钮 Android
add buttons in front of javacameraview Android
我的主 activity 中有一个 javacameraview。我想在相机前面放一些控制按钮
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.gustavo.tassio.opencvnativeandroid.Principal">
<org.opencv.android.JavaCameraView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:show_fps="true"
app:camera_id="any"
android:id="@+id/cameraOpenCv"/>
JavaCameraView cameraView;
cameraView = (JavaCameraView) findViewById(R.id.cameraOpenCv);
cameraView.setVisibility(SurfaceView.VISIBLE);
cameraView.setCvCameraViewListener(this);
现在是这样的,纯图,我的想法是把按钮放在这个场景上
https://i.stack.imgur.com/9YKyP.jpg
如果您在框架布局中添加按钮,它们将按您的意愿显示。 framelayout 中的视图按时间顺序显示。当您更改框架布局的子视图的可见性时,它的顺序不会改变,您在 xll 中或以编程方式添加到它之后的所有子视图都将被绘制 "above".
我的主 activity 中有一个 javacameraview。我想在相机前面放一些控制按钮
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.gustavo.tassio.opencvnativeandroid.Principal">
<org.opencv.android.JavaCameraView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:show_fps="true"
app:camera_id="any"
android:id="@+id/cameraOpenCv"/>
JavaCameraView cameraView;
cameraView = (JavaCameraView) findViewById(R.id.cameraOpenCv);
cameraView.setVisibility(SurfaceView.VISIBLE);
cameraView.setCvCameraViewListener(this);
现在是这样的,纯图,我的想法是把按钮放在这个场景上
https://i.stack.imgur.com/9YKyP.jpg
如果您在框架布局中添加按钮,它们将按您的意愿显示。 framelayout 中的视图按时间顺序显示。当您更改框架布局的子视图的可见性时,它的顺序不会改变,您在 xll 中或以编程方式添加到它之后的所有子视图都将被绘制 "above".