Wax for iPhone5

152 Views Asked by At

Wax is a nice framework, we can programming in lua on iOS. I try it on iPhone5, the code:

local frame =UIScreen:mainScreen():bounds()

always return 320*480. This is not right on iPhone5. How to return the correct frame of the device screen?

The Wax support the iPhone4, iPad? Or the Wax only support iPhone4s and below device?

After my search, I find the solution: add [email protected] to project.

2

There are 2 best solutions below

0
On

I believe it's to do with the difference between points and pixels.

See That's the difference between points and pixels.

0
On

Acturally Wax doesn't support iPhone4 or 5 or 6 plus, Wax only a framework to bridge your native code and Lua code. Wax doesn't care about the device type or iOS SDK version.

The following code just call UIScreen's method from ObjC Runtime,

local frame =UIScreen:mainScreen():bounds()

So if you haven't do anythings to change Wax's origin logical, I'm pretty sure the return should be same no matter the code is native or lua.

If you cannot find out the odd issue's reason, what I suggest is write a native bridge method like

[CustomUtility getApplicationScreenSize] 

to get over it. Since Wax framework is no longer maintained for such long time, I suggest to use JSPatch instead of it also.

Maybe you give more code we can find out where goes wrong.