Search code examples
cordovauser-interfacecordova-pluginsonsen-uingcordova

How to left align photos when choosing image in gallery using wymsee imagepicker


Thanks to wymsee/imagePicker, I can easily get image picking feature work in my apps built with Onsen UI.

But then I am facing the inconsistency UI issue on different platforms, which is that photos isn't left aligned in iOS platform.

Example Image: Android & iOS alignment are not consistent

What can we do in order to get both platforms have the images in "Pick Photos" gallery left aligned, is it possible?


Solution

  • I looked inside the objective-c source code of the plugin and I've found that it uses (for iOS) some classes from another project called ELCImagePickerController. Inside the source code of this project you can find some references about alignment:

    self.alignmentLeft = YES;
    //...
    if (self.alignmentLeft) {
        startX = 4;
    //...
    

    that are missing in the same file inside the plugin.

    Looking inside the project history, I've found that the left alignment options was added in a commit on october 2014, but related files inside the cordova plugin were added on january 2014!.

    So, you could fix it yourself updating classes (plus fixing bugs eventually) and make a pull request to the plugin repository, or you can ask the author to update the plugin.