我正在尝试缩小CameraX TextureView预览的高度。
PreviewConfig previewConfig = new PreviewConfig.Builder()
.setTargetRotation(getWindowManager().getDefaultDisplay().getRotation())
.setTargetResolution(new Size(1280, 720))
.build();
Preview preview = new Preview(previewConfig);
<TextureView
android:id="@+id/view_finder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
如上所示,我的配置非常简单。
无论我设置什么分辨率,都根本不起作用。
有人能告诉我如何修复这个问题吗?
但是我的输出是正确的。只是预览会出现这种情况。