hansemannn / titanium-image-crop

An easy to use iOS image cropping tool based on TOCropViewController.
MIT License
40 stars 5 forks source link

Closes Modal #3

Closed designbymind closed 3 years ago

designbymind commented 3 years ago

If ImageCrop is opened within (over) a Modal Window, it closes said modal after done or cancel events are called & app becomes unresponsive.

designbymind commented 3 years ago

Update: After some research and testing, I found a workaround for the Modal Window being removed from Ti context/stack after ti.imagecrop done or cancel events are called. Just wanted to share in case anyone else runs into this issue...

The required modalStyle property to be applied when opening a modal window is: modalStyle: Ti.UI.iOS.MODAL_PRESENTATION_OVER_CURRENT_FULL_SCREEN

Example:

// Open Add Photo (modal) Window (the window `ti.imagecrop` is called from)
Alloy.createController('path/to/your/modal/window/controller').getView().open({
    modal: true,
    forceModal: false,
    modalStyle: Ti.UI.iOS.MODAL_PRESENTATION_OVER_CURRENT_FULL_SCREEN, // Important
    modalTransitionStyle: Ti.UI.iOS.MODAL_TRANSITION_STYLE_COVER_VERTICAL
});
hansemannn commented 3 years ago

Readme updated!