开发者

android: video as background view

I want to play video in background of the view.In view i want to some other view like button and textview, can it is possible to do that? i have try using the following code <

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" 
      开发者_C百科  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>

Please suggest me how can it possible to do it.

Thank you.


Not sure if you can put a videoView in background. The better option would be to use a frame layout with a transparent background and put your other views on the top of it.


Shafi is right i m just posting code how i have done,

 <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"

         />.....

I hope this code will help some one. Thank you

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜