Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The crop box is not in the center of the view #58

Open
mafanwei opened this issue May 21, 2021 · 1 comment
Open

The crop box is not in the center of the view #58

mafanwei opened this issue May 21, 2021 · 1 comment

Comments

@mafanwei
Copy link

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:
image
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:
image
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:
image

It's seem to something wrong in onMeasure.

@mafanwei
Copy link
Author

I Only change width and height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant