在我的主要活动中有一个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);就像现在,纯粹的图像,我的想法是把按钮放在这个场景上。
发布于 2018-04-13 06:07:40
如果您向框架外添加按钮,它们将按您的意愿显示。framelayout中的视图按时间顺序显示。当您更改framelayout的子视图的可见性时,它的顺序不会改变,在它之后添加的所有子视图(无论是在xll中还是以编程方式添加的)都将被绘制为“上面”。
https://stackoverflow.com/questions/49806916
复制相似问题