0

J'ai cette mise en page:Obtenir un rembourrage en vue de la caméra en plein écran (FrameLayout)

`

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    android:orientation="vertical" 
    android:padding="0dp" 
    android:background="@android:color/transparent" 
    android:id="@+id/parent_view" 
> 

    <FrameLayout 
     android:id="@+id/camera_preview" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     > 


     <Button 
      android:id="@+id/button_capture" 
      android:layout_width="50dp" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:layout_marginTop="50dp" 
      android:text="Capture" /> 
    </FrameLayout> 


</LinearLayout> 

` Je reçois un rembourrage noir en mode appareil photo comme celui-ci, sur le côté droit, notez la verticale noir espace/bande sur la droite: enter image description here

Ne pas déranger le bouton de capture au milieu de l'écran, je le positionnerai plus tard. Mais la question que je me pose est, comment supprimer le rembourrage indésirable et faire FramLayout en plein écran?

Répondre

0

CameraSourcePreview doesn't fill whole screen height ce bug fixé par

Commentaire ou supprimer des lignes ci-dessous de CameraSourcePreview.java

if (childHeight > layoutHeight) { 
childHeight = layoutHeight; 
childWidth = (int)(((float) layoutHeight/(float) height) * width); 
} 
+0

Je ne suis pas en utilisant cameraSourcePreview, que vous avez mentionné. –