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

Set aspect ratio UI issue #657

Open
DiFilosofa opened this issue Dec 4, 2024 · 0 comments
Open

Set aspect ratio UI issue #657

DiFilosofa opened this issue Dec 4, 2024 · 0 comments

Comments

@DiFilosofa
Copy link

So i'm using the CropImageView to set a fixed crop ratio. my expectation is that the crop frame is fixed with 16:6 ratio. So this is what i do in the code.

private fun setCropOption() {
        binding?.cropImageView?.apply {
            val options = CropImageOptions()
            options.cropShape = CropImageView.CropShape.RECTANGLE
            options.guidelines = CropImageView.Guidelines.ON
            options.autoZoomEnabled = true
            options.centerMoveEnabled = true
            options.showCropOverlay = true
            options.showProgressBar = true
            options.cornerShape = CropImageView.CropCornerShape.RECTANGLE
            setImageCropOptions(options)
            setAspectRatio(16, 6)
        }
    }

when i set this it has some UI issue when the crop image is visible like this on init.

image

It can be drag and resize manually but for initial state, it's very small, how can we set it default to match the image witdth like default 1:1 state?

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