2017-08-05 8 views
1

ビデオコールのレイアウトを作成してこの問題に直面しました swithcカメラ、ミュート、エンドコール、およびいくつかの情報のためにsurfaceView上にimageViewとボタンのいくつかを追加したいのですが、これは私のxmlです。android add view over surfaceView

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
    > 


<org.webrtc.SurfaceViewRenderer 
    android:id="@+id/preview" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 


<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 



<LinearLayout 
    android:id="@+id/rind" 
    android:orientation="horizontal" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
     <!-- here my ImageView and button --> 

    </LinearLayout> 



</RelativeLayout> 

私はカントSE、これを実行するとSurfaceViewRendererは今surfaceView

を拡張私のカメラSurfaceViewと私は私のSurfaceViewRendererのための赤い背景を追加し、私のカメラのディスプレイなしで表示されます私はちょうど検索し、私は見つけたmySurfaceView.setZOrderOnTop(true);私はそのカメラの表示を追加するが、私は私のビュー(ミュート、終了呼び出し...)

も私はちょうど私がglsurfaceview BUを試してみました私はsurfaceViewを使用する前にこの

のようなレイアウトを作りたい

mySurfaceView.setZOrderMediaOverlay(true); 

    mySurfaceView.getHolder().setFormat(PixelFormat.TRANSPARENT); 

何の効果

を試していませんトンその同じと私は、これはあなたを助ける、この希望をお試しくださいglsurfaceview

enter image description here

答えて

0

に(glsurfaceviewオーバービューを追加)私はそれを行うことはできませんお読みください。

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

<FrameLayout 
    android:clipChildren="false" 
    android:id="@+id/main_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

<!--local view--> 
<com.example.gwl.apprtc.PercentFrameLayout 
    android:id="@+id/local_video_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

<org.webrtc.SurfaceViewRenderer 
     android:id="@+id/local_video_view" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"/> 
<!--remote View --> 
</com.example.gwl.apprtc.PercentFrameLayout> 
<com.example.gwl.apprtc.PercentFrameLayout 
    android:id="@+id/remote_video_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

<org.webrtc.SurfaceViewRenderer 
     android:id="@+id/remote_video_view" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"/> 

</com.example.gwl.apprtc.PercentFrameLayout> 
<!----> 
</FrameLayout> 
<FrameLayout 
    android:id="@+id/buttons_call_container" 
    android:orientation="horizontal" 
    android:layout_marginBottom="@dimen/marginBottom_32dp" 
    android:layout_gravity="bottom|center" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"> 

<LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 

<ImageButton 
      android:id="@+id/button_call_disconnect" 
      android:background="@drawable/disconnect" 
      android:contentDescription="@string/disconnect_call" 
      android:layout_width="@dimen/layoutWidth_48dp" 
      android:layout_height="@dimen/layoutHeight_48dp"/> 

<ImageButton 
      android:id="@+id/button_call_toggle_mic" 
      android:background="@android:drawable/ic_btn_speak_now" 
      android:contentDescription="@string/toggle_mic" 
      android:layout_marginRight="@dimen/marginRight_10dp" 
      android:layout_width="@dimen/layoutWidth_48dp" 
      android:layout_height="@dimen/layoutHeight_48dp"/> 

<ImageButton 
      android:id="@+id/button_call_switch_camera" 
      android:background="@android:drawable/ic_menu_camera" 
      android:layout_marginEnd="8dp" 
      android:layout_width="48dp" 
      android:layout_height="48dp"/> 


</LinearLayout> 

</FrameLayout> 

</FrameLayout> 
関連する問題