Open mafanwei opened 3 years ago
When I fix view's width or height: <com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="200dp" android:layout_height="200dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" /> The Image is: When I use this: <com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="300dp" android:layout_height="200dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" /> The Image is: Only Use this: <com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="0dp" android:layout_height="0dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" /> It's fine:
<com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="200dp" android:layout_height="200dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" />
<com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="300dp" android:layout_height="200dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" />
<com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="0dp" android:layout_height="0dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" />
It's seem to something wrong in onMeasure.
I Only change width and height.
When I fix view's width or height:
<com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="200dp" android:layout_height="200dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" />
The Image is: When I use this:<com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="300dp" android:layout_height="200dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" />
The Image is: Only Use this:<com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="0dp" android:layout_height="0dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" />
It's fine:It's seem to something wrong in onMeasure.