Question about systemvars Viewport Height

Does the Viewport Height value change randomly, or does something else cause it to change? It seems like once a week this value changes on my phone, and since I have containers that set their height based on this value in formulas I have to spend another day going through my app changing everything…

So I need to know why this value keeps changing and if it is unpredictable then what would a better thing to use to calculate pixel-perfect container heights on devices.

Edit: It seems to just be occuring on one particular phone. My old phone looks fine. This is worrisome because just yesterday everything looked fine on my newer phone.

Edit: If I change to use Window Height then it looks like it’s supposed to on new phone, but the old phone has a gap in it.

2 Likes

I found a solution by accident. If I store the value of Viewport Height in an app variable on the Global Canvas App Launched event then it is the correct value I expect.

Apparently for whatever reason Viewport Height value changes after the first page loads.

3 Likes

Nice! I will have to try that out. I too have found Viewport Height to be incorrect at times and had to apply a fudge factor to it. Didn’t feel good about that as a long term solution.

I was getting unexpected changes using sys var view height… my greatest discover has been to set page layout to stretch to viewport… and then adding a container that acts as my base layout that I create everything else inside after I set the width and height to 100%. Have not had errors or gaps since. Just wanted to share hope this may help some folks.

2 Likes