2017-05-28 1 views
0

Ich mache eine App, die eine transparente View (CustomView2) über Camera2 Video-Textur-Ansicht überlagert, so dass mit den Fingern auf der Oberseite der Kamera zu zeichnen.Ansicht über TextureView: Nur der Hochformat-Modus funktioniert

Die Zeichnung funktioniert im Hochformat, im Querformat jedoch nicht.

Ich stelle fest mein XML ist schlecht .. Kann mir jemand dabei helfen?

hier ist sie:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <com.example.android.camera2video.AutoFitTextureView 
     android:id="@+id/texture" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentTop="true" /> 

    <com.example.android.camera2video.CustomView4 
     android:id="@+id/texture2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentStart="true" 
     android:orientation="horizontal" 
     android:layout_gravity="fill_horizontal" 
     android:layout_alignParentTop="true" /> 



    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentStart="true" 
     android:layout_below="@id/texture" 
     android:background="#4285f4"> 

     <Button 
      android:id="@+id/video" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:text="@string/record" /> 

     <ImageButton 
      android:id="@+id/info" 
      android:contentDescription="@string/description_info" 
      style="@android:style/Widget.Material.Light.Button.Borderless" 
      android:layout_width="4dp" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_vertical|right" 
      android:padding="20dp" 
      android:src="@drawable/ic_action_info" /> 

    </FrameLayout> 

</RelativeLayout> 

Antwort

0

Gelöst .. im Layouteditor I-Modus das Layout Porträt zu fügen hatte speziell

Verwandte Themen