1

I'm using openCV's JavaCameraView in android and i'm trying to add an image button and text view on top of it. I tried to add it from the design and the xml is:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.lama.myapplication.MainActivity">



<org.opencv.android.JavaCameraView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_alignParentRight="true"
    android:layout_alignParentLeft="true"
    android:gravity="center"
    android:layout_marginLeft="-8dp"
    android:id="@+id/java_camera_view"
    tools:layout_editor_absoluteY="0dp"
    app:layout_constraintLeft_toLeftOf="parent" />

<ImageButton
    android:id="@+id/imageButton2"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:scaleType="fitCenter"
    android:background="@null"
    app:srcCompat="@drawable/loud" />


 </android.support.constraint.ConstraintLayout>

but this didn't work and the button is not shown, how can I do it?

Lama Tatwany
  • 95
  • 5
  • 16

0 Answers0