3

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?

Trtshen Chaw
  • 353
  • 2
  • 10
  • You can write platform specific css. A simple way is to add the platform of your devise to the body of your html. Then you can pick up this class in your css. To get the platform and version you can use the devise plugin. – Joerg Sep 14 '15 at 04:52
  • 2
    those are native views, you can't controll them – jcesarmobile Sep 14 '15 at 06:05

1 Answers1

1

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.

lifeisfoo
  • 15,478
  • 6
  • 74
  • 115
  • thank you @lifeisfoo for the guidance, I was wondering if there is more straight and simpler way like using only ngCordova to solve this problem.And yes, it seems this is the only way is to learn a bit objective-c to get the result I expected. – Trtshen Chaw Sep 14 '15 at 14:38
  • And found there is an existing imagePicker plugin repo [forked and well updated by Hanssens](https://github.com/hanssens/cordova-imagePicker) which perfectly suit my need. Let me share here for those who this as solution. – Trtshen Chaw Sep 14 '15 at 14:45