Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VideoView does not fill layout

I made a videoview and at the bottom of the screen there is another relative layout. In simulator it shows ok how it should be, but when i launch the app it doesnt.

Image from emulator

Now when i launch it shows me such layout

Layout when launching app

Am i doing something wrong in the code behind?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <VideoView
        android:id="@+id/video_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/buttonsLayout" />

    <RelativeLayout
        android:id="@+id/buttonsLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="#404040"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/button_accept_video"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:layout_margin="10dp"
            android:src="@mipmap/accept" />

        <ImageView
            android:id="@+id/button_reject_video"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_margin="10dp"
            android:src="@mipmap/reject" />

    </RelativeLayout>
</RelativeLayout>
like image 774
Unknown Avatar asked Dec 29 '15 13:12

Unknown


1 Answers

Try adding the following attributes in VideoView.

android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"

Check this for reference.

like image 143
Faraz Avatar answered Oct 20 '22 01:10

Faraz