title: Android match_parent on child not reaches weight from parent
body: <p>Like in title. Layout looks great on Android Studio, but when I get it on real device it looks bad. The JavaCameraView takes only half of the screen while in Android Studio takes about 3/4 as it should be. JavaCameraView should reach horizontal bar shown on screen.</p>
  <p>Here are my screenshots.</p>
  <p>On Android Studio:</p>
  <p><a href="https://i.stack.imgur.com/RWT0s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RWT0s.png" alt="enter image description here" /></a></p>
  <p>On real device:</p>
  <p><a href="https://i.stack.imgur.com/0r6bR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0r6bR.png" alt="enter image description here" /></a></p>
  <p>Layout Inspector shows that this RelativeLayout that hosts JavaCameraView occupies all that space but JavaCameraView with height:match_parent not behaves like that:</p>
  <p><a href="https://i.stack.imgur.com/mftU0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mftU0.png" alt="enter image description here" /></a></p>
  <p>Why is that so?</p>
  <p>Here is my layout:</p>
  <pre><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:opencv=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:orientation=&quot;vertical&quot;&gt;
  
  &lt;RelativeLayout
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;0dp&quot;
      android:layout_weight=&quot;5&quot;
      android:layout_above=&quot;@+id/scroll_view&quot;&gt;
  
  
      &lt;org.opencv.android.JavaCameraView
          android:id=&quot;@+id/java_surface_view&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:layout_alignParentTop=&quot;true&quot;
          opencv:camera_id=&quot;any&quot;
          opencv:show_fps=&quot;true&quot; /&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;ScrollView
      android:id=&quot;@+id/scroll_view&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;0dp&quot;
      android:layout_weight=&quot;1&quot;
      android:layout_marginBottom=&quot;?actionBarSize&quot;&gt;
  
      &lt;RelativeLayout
          android:id=&quot;@+id/rl&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;&gt;
  
          &lt;View
              android:id=&quot;@+id/View1&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;2dp&quot;
              android:layout_marginTop=&quot;5dp&quot;
              android:layout_marginBottom=&quot;5dp&quot;
              android:background=&quot;@android:color/darker_gray&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/alert_pxcm_too_small&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_below=&quot;@id/View1&quot;
              android:layout_centerHorizontal=&quot;true&quot;
              android:gravity=&quot;center_horizontal&quot;
              android:textColor=&quot;#FF0000&quot;
              android:textSize=&quot;@dimen/text_size_rest&quot;
              android:visibility=&quot;visible&quot; /&gt;
  
          &lt;Spinner
              android:id=&quot;@+id/spinner&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_centerHorizontal=&quot;true&quot;
              android:layout_marginTop=&quot;10dp&quot;
              android:layout_below=&quot;@id/alert_pxcm_too_small&quot;/&gt;
          &lt;TextView
              android:id=&quot;@+id/measurements_width_converter&quot;
              android:layout_marginTop=&quot;15dp&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_below=&quot;@id/spinner&quot;
              android:layout_centerHorizontal=&quot;true&quot;
              android:gravity=&quot;center_horizontal&quot;
              android:textColor=&quot;#0000FF&quot;
              android:text=&quot;@string/width_info&quot;
              android:textSize=&quot;@dimen/text_size_rest&quot;
              android:visibility=&quot;visible&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/measurements_height_converter&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_below=&quot;@id/measurements_width_converter&quot;
              android:layout_centerHorizontal=&quot;true&quot;
              android:gravity=&quot;center_horizontal&quot;
              android:textColor=&quot;#0000FF&quot;
              android:text=&quot;@string/width_info&quot;
              android:textSize=&quot;@dimen/text_size_rest&quot;
              android:visibility=&quot;visible&quot; /&gt;
  
      &lt;/RelativeLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>If you need something more just ask. Probably you will need also some Java code of classes, this fragment etc. Thank you in advance! :)</p>