Software Archive
Read-only legacy content
17061 Discussions

Intel XDK - IOS App page stretches continiously but code works on Android

Kevin_k_1
Beginner
243 Views

Hello

I have built an App using HTML5. DIv & images sizes have been set using screen percentage.

i.e.

<img src="1.jpg" width="100%" height="100%">

This approach works fine and the page adjusts on web-browsers and andriod devices. However on IOS the page continually stretches and stretches the page outwards.

Is there some code that needs to be inserted to stop this from happening?

 

Many Thanks,

Kevin

 

0 Kudos
1 Reply
Chris_P_Intel
Employee
244 Views

It's hard to diagnose. 


But have you looked at using vw/vh coordinates instead of %?  The percentage is tricky, because it is very nesting sensitive. But the vh and vw coordinates are simple: percentage of viewport width (or viewport height).

This simple CSS rule might be all you need:

img {
  width: 100vw;
  height: 100vh;
}

 

0 Kudos
Reply