In my mobile app, I have an image that I need to be centered on iPhone 5 and BlackBerry Z10. I can center it for one or the other by adjusting the image dimensions and/or margins, but seeing as they have different pixel dimensions, I can't seem to make the image centered on both devices.
I have a feeling there's a quick, easy fix for this but I'm just not seeing it.
I used CSS in the page load even handler. Note that it's the DIV containing the image that needs manipulation, not the image itself.
Thanks for the reply. I can't seem to find the 'div containing the image' in the OE mobile app builder. I've also tried adding the code you've provided, but the image still isn't centered. Can you offer any more specific instruction?
It's a hidden/generated one. I think the name matches to "_div" so you could try that first.
I'm relatively sure I found that out in the appery.io doc somewhere but I'll have to dig around to be sure.
I've tried a few things, including creating this CSS class and making it the class for the image:
It seems to me that the pixel dimensions and margins of the image are overriding any JS code or CSS class, because the JS and CSS I've tried has had no effect on the image. Can anyone confirm this for me, and/or offer a solution?
I've found a solution. I found out the image was being centered, but my image dimensions were too big for the centering to work as I wanted it to. I just had to make my image a bit smaller and include the JS code from this page: http://docs.appery.io/documentation/app-builder/building-mobile-ui/#Centering_a_component_for_device_rotation