2017-04-24 55 views
0

我在我的應用程序上有一個videoview。VideoView上的徽標?

我可以把按鈕放在videoview上,但imageview我不能放它。

佈局:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" > 
<VideoView android:id="@+id/video_view" 
    android:layout_width="fill_parent" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentBottom="true" 
    android:layout_height="fill_parent"> 
</VideoView> 

<Button 
    android:id="@+id/button1" 
    android:layout_width="280dp" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="22dp" 
    android:background="@drawable/button" 
    android:text="@string/login" 
    android:layout_above="@+id/button2" 
    android:layout_alignLeft="@+id/button2" 
    android:layout_alignStart="@+id/button2" /> 

<Button 
    android:id="@+id/button2" 
    android:layout_width="280dp" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="109dp" 
    android:background="@drawable/button" 
    android:text="@string/signup" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true" /> 

活動: My Activity.txt

我想把標誌上的視頻。我能做些什麼呢?

+0

使用框架佈局,並把在視頻查看 – rahul

+0

我用頂部的標誌「ImageView的」。但也沒有工作。 –

+0

你可以分享你想要實現的UI嗎? – rahul

回答

0

我解決此問題與Android:背景資料。

<VideoView android:id="@+id/video_view" 
android:layout_width="fill_parent" 
android:layout_alignParentRight="true" 
android:layout_alignParentLeft="true" 
android:layout_alignParentTop="true" 
android:layout_alignParentBottom="true" 
android:layout_height="fill_parent" 
android:background="@drawable/pngname"> 

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

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

    <ImageView 
    android:id="@+id/yourImageViewId" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@mipmap/ic_launcher"/> 

</FrameLayout> 

試試這個

+0

我累了,也許10次。還是行不通。 –