I am trying to stretch my video view inside the linear layout to full screen but it doesn't match the device screen. Here is my code
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="720dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_gravity="fill_horizontal"
android:layout_marginTop="140dp" >
<VideoView
android:id="@+id/videoView1"
android:layout_width="fill_parent"
android:layout_height="720dp" />
</LinearLayout>
There is always 10 to 15 dp space on left and right each. Also the Linear layout is not stretching to full screen. I want it to fill the screen in width.
Actually there's no need to set width programmatically
android:layout_width="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
Should suffice to fill the container with full width video view. And use match_parent instead of fill_parent. Hope this helps somebody.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With