-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detecting screen size problem #111
Comments
It seems that at least on my android (2.2), MOAIGfxDevice.getViewSize() return 0 even at the beginning of RNFactory.init method, but on windows it only return a value after MOAISim.openWindow is called. So changing the first part of RNFactory.init() to the following would make sure that the app can detect the screen size appropriately (taking into account status bars), at least for android and window host.
I don't have access to an ios device right now to test that. |
Hi Sylph, I've changed
to
this should work to fix the problem. Tested on my Android and iOS devices. Thanks for the issue, sorry but on my Android the previous code worked well :D |
Yw. :) On Mon, Mar 25, 2013 at 8:30 AM, Mattia Fortunati
|
Basically, we know that line 47 RNFactory
local screenX, screenY = MOAIEnvironment.screenWidth, MOAIEnvironment.screenHeight
has changed to
local screenX, screenY = MOAIEnvironment.horizontalResolution, MOAIEnvironment.verticalResolution
on newer MOAISDK builds,
But this still doesn't take into account the status bar size in several devices I've tested (Archos 70 IT running Android 2.2)
I have to replace line 75-76
RNFactory.width = lwidth RNFactory.height = lheight
with
RNFactory.width, RNFactory.height = MOAIGfxDevice.getViewSize()
to get the proper screen size so that the viewport doesn't overlap with the status bar on the archos, but it the bottom is still cut off when using HTC inspire (running Jelly Bean). I'll research more on this.
The text was updated successfully, but these errors were encountered: