问题
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"
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.
回答1:
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.
回答2:
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
来源:https://stackoverflow.com/questions/7074600/android-video-as-background-view