Thursday, March 17, 2016

Ionic - Testing iOS Layout and Styling in Browser

So...I use "ionic serve" to test my mobile app layout and styling a LOT. Then deploy to devices for more testing. It really helps in the development process.

During testing of one of my apps I noticed the iOS version had some different styling issues and for the life of me I couldn't figure it out. To be specific, there was a thin white bar just under the title of the various ionic screens, even the side menus. Weird!

Using Chrome developer tools and using "toggle device mode" to iPhone 6 or some other iOS device type did not give me the same results as an actual device.

Here's what I found after a bunch of Googling...

Add these classes to the BODY of your index.html

class="platform-ios platform-cordova platform-webview"

And Viola! The issues I was seeing on my device were now showing up in my browser.

Now, I have to remember to remove these when I do my build? Yes.