4

ビューのバックグラウンドでビデオを再生したい.ビュー内で、ボタンやテキストビューなどの他のビューが必要ですが、それを行うことは可能ですか? 次のコードを使用してみました<

RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <VideoView 
        android:scrollbars="none"
        android:clickable="false"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"      
        android:fitsSystemWindows="true"
        android:id="@+id/VideoView">
        </VideoView>
<TextView 
    android:text="hi123"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
/>

</RelativeLayout>

どうすればそれが可能になるか教えてください。

ありがとうございました。

4

2 に答える 2

5

videoView をバックグラウンドに配置できるかどうかわかりません。より良いオプションは、背景が透明なフレーム レイアウトを使用し、その上に他のビューを配置することです。

于 2011-08-16T07:13:56.230 に答える
4

Shafi は正しいです。私が行った方法でコードを投稿するだけです。

 <merge xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">
<VideoView  
        android:scrollbars="none"
        android:clickable="false"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"      
        android:fitsSystemWindows="true"
        android:id="@+id/videoView"

         />.....

このコードが誰かに役立つことを願っています。ありがとうございました

于 2011-09-02T12:51:19.317 に答える