-1

I have implemented a video view within a relative layout. I have set specific layoutWidth and layoutHeight for my relative layout and am trying to match parent for the video view.

My problem is the video view wont respond to the code.

This is my XML view:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="800dp"
    android:layout_height="600dp"
    android:background="@drawable/background"
    android:orientation="vertical" >

    <!-- Header -->

    <include
        android:id="@+id/include1"
        layout="@layout/video_menu_header" />

    <VideoView
        android:id="@+id/videoView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/include1"
        android:layout_centerHorizontal="true"
         />

</RelativeLayout>

Why the videoView does not fill the RelativeLayout?

AndroidKrayze
  • 349
  • 2
  • 5
  • 21
  • Possible duplicate: [Resize VideoView](http://stackoverflow.com/questions/4434027/android-videoview-orientation-change-with-buffered-video/4452597#4452597) – BlueSword Feb 06 '14 at 04:49
  • 1
    The question is not clearly stated. "Won't respond to the code" is not really helpful. State what its doing, and what you expect it to do. – jww Feb 06 '14 at 08:46

1 Answers1

0

I found the solution. What I was trying to do is resize the videoView according to the relativeLayout width and height. I modified the code to :

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="600dp"
    android:background="@drawable/background"
    android:orientation="vertical" >

    <!-- Header -->

    <include
        android:id="@+id/include1"
        layout="@layout/video_menu_header" />

    <VideoView
        android:id="@+id/videoView1"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@+id/include1"
        android:layout_centerHorizontal="true"
         />

</RelativeLayout>
AndroidKrayze
  • 349
  • 2
  • 5
  • 21