Saturday, June 11, 2016

Window.getClientHeight() not correct for pages opened on iOS via an app like Facebook

Had a problem that Window.getClientHeight() would give a height too big when my page was opened via Facebook on iOS.  Think it was related to this bug:  http://stackoverflow.com/questions/27379581/web-page-not-getting-100-height-in-twitter-app-on-ios-8

So, I wrote my own methods:

public static native int getWindowInnerHeight() /*-{
    return $wnd.innerHeight;
}-*/;

public static native int getWindowInnerWidth() /*-{
    return $wnd.innerWidth;
}-*/;

And they work fine.  Hope this is of help to someone.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment