2016-12-19 7 views
0

画面全体にビデオの背景がありたい。すべてが正しくJavaで動作します:ループなど。問題はxmlにある可能性があります。 は現在、私は、画面の上にビデオを持って、それは次のようになります。 enter image description here画面全体のビデオ背景

何をしてください:(ビデオはperfecltyエッジに装着されている)enter image description here

私の目的は完全に私の画面でそれを持っていることですが私は私の目標を達成するために私のXMLの外観を作る必要があります。ありがとう。

XML:

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

<VideoView 
    android:id="@+id/surface" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
/> 
</FrameLayout> 

答えて

1

まずあなたは、このコードは、このlink

をチェックアウト動作しない場合は、あなたの目的は、ランドスケープモード

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); // add it below super.oncreate 

であることを特徴とするので、あなたが横に向きを設定する必要があります

か、マニフェストの方向をGoogleに設定することができます。

そして、私は横に私の画面の向きを変更する必要はありませんが、画面全体に私のVideoviewを作るために何かを作るためにあなたのxml

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

<VideoView 
    android:id="@+id/surface" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="center" 
/> 
</FrameLayout> 
+0

でこれを変更します。現在、私は画面上部にこのビデオを持っています –

関連する問題