在camerax的模拟器中拉伸预览

时间:2019-12-20 07:07:50

标签: android camera textureview android-camerax

TextureView在模拟器中拉伸。如果我将TextureView的宽度和高度设置为正方形(500dp x 500dp)。在模拟器中,预览被拉伸并显示在矩形中。

此代码取自Google Sample中的CameraX。

这是我的fragment_camera.xml代码:

<TextureView
        android:id="@+id/view_finder"
        android:layout_width="500dp"
        android:layout_height="500dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

为相同的内容附加屏幕截图: Camerax Preview

0 个答案:

没有答案