In my OpenCV app, in the following layout, the root ViewGroup is a FrameLayout
with android:layout_width="match_parent"
and android:layout_height="match_parent"
, and has no android:padding
.
This FrameLayout contains a JavaCameraView
which also has android:layout_width="match_parent"
as well as android:layout_height="match_parent"
, and has no android:layout_margin
.
So the JavaCameraView
should span the entire screen. But instead, it has a black padding above and below it. How can I get rid of this padding above and below JavaCameraView
?
According to this answer, JavaCameraView
inherits from SurfaceView
. So it should respect the layout_width and layout_height properties of itself and its parent in the view hierarchy right?
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<org.opencv.android.JavaCameraView
android:id="@+id/mainActivity_javaCameraView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>