簡體   English   中英

在Android中播放視頻時,VideoView不能覆蓋整個屏幕

[英]VideoView does not cover whole screen while playing videos in Android

我已經開發了使用VideoView播放視頻的媒體播放器。 它工作正常,但存在一個問題,即播放視頻的底部有空白。 您可以檢查我的代碼和播放器的屏幕截圖。 在這方面請幫助我,我將非常感謝您。 提前致謝。

在此處輸入圖片說明

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    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"
    />

</LinearLayout>

這應該可行,它將使您的視頻拉伸到整個屏幕:

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

  <VideoView android:id="@+id/videoViewRelative"
       android:layout_alignParentTop="true"
       android:layout_alignParentBottom="true"
       android:layout_alignParentLeft="true"
       android:layout_alignParentRight="true"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent">
  </VideoView>

</RelativeLayout>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM