【问题标题】:crop ratio getting changed when expanding crop area in image_cropper flutter在 image_cropper 颤动中扩展裁剪区域时裁剪比例发生变化
【发布时间】:2022-01-10 09:48:45
【问题描述】:

1:1,4:3或16:9 作物纵横比选择时,如何锁定纵横比。 When original ratio selected make aspect ratio unlock.

它在 iOS 上可以正常工作,但在 android 平台上出现问题。

这是我使用的代码。

  val = (await ImageCropper.cropImage(
  sourcePath: pickedFile!.path,
  compressQuality: 100,
  maxHeight: 700,
  maxWidth: 700,
  compressFormat: ImageCompressFormat.jpg,
  androidUiSettings: AndroidUiSettings(
      toolbarColor: ColorConstants.primaryColor,
      toolbarWidgetColor: ColorConstants.customBlackColor,
      lockAspectRatio: false,
      toolbarTitle: "Wood",
      activeControlsWidgetColor: ColorConstants.primaryColor),

  iosUiSettings: IOSUiSettings(
      resetButtonHidden: false,
      aspectRatioLockEnabled: false,
      rotateButtonsHidden: false,
      rotateClockwiseButtonHidden: false)))!;

【问题讨论】:

    标签: android flutter image-cropper


    【解决方案1】:

    对于 android,您需要将 lockAspectRatio 设置为 true。这是默认值。您将其设置为false

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-01
      • 1970-01-01
      • 2023-03-09
      • 2013-08-11
      相关资源
      最近更新 更多