roycornelissen / GMImagePicker.Xamarin

Port of the original GMImagePicker component to Xamarin.iOS
MIT License
71 stars 39 forks source link

Picker auto scroll to bottom when selecting images #71

Closed dustintnguyen closed 4 years ago

dustintnguyen commented 4 years ago

I have implemented the picker in iOS for multiple selection. When scrolling up to select older images the picker will snap the scroll to the bottom after a few second while scrolling to select older images. Below is how I am implementing the picker:

        mediaPickTcs = new TaskCompletionSource<IList<MediaFile>>();
        currentPicker = new GMImagePickerController() {
            Title = title,
            MediaTypes = new[] { type },

        };

        currentPicker.FinishedPickingAssets += FinishedPickingAssets;

        var window = UIApplication.SharedApplication.KeyWindow;
        var vc = window.RootViewController;
        while (vc.PresentedViewController != null) {
            vc = vc.PresentedViewController;
        }

        await vc.PresentViewControllerAsync(currentPicker, true);

        var results = await mediaPickTcs.Task;

        currentPicker.FinishedPickingAssets -= FinishedPickingAssets;
        OnMediaPickedCompleted?.Invoke(this, results);

If anyone else is experiencing or have a fix please help.

Thank you!