简体   繁体   English

适用于iPhone5的蜡

[英]Wax for iPhone5

Wax is a nice framework, we can programming in lua on iOS. Wax是一个不错的框架,我们可以在iOS上的lua中进行编程。 I try it on iPhone5, the code: 我在iPhone5上尝试过,代码:

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

always return 320*480. 始终返回320 * 480。 This is not right on iPhone5. 这不适用于iPhone5。 How to return the correct frame of the device screen? 如何返回设备屏幕的正确框架?

The Wax support the iPhone4, iPad? 蜡支持iPhone4,iPad吗? Or the Wax only support iPhone4s and below device? 还是蜡只支持iPhone4s及以下设备?

After my search, I find the solution: add Default-568h@2x.png to project. 搜索之后,我找到了解决方案:将Default-568h@2x.png添加到项目中。

Acturally Wax doesn't support iPhone4 or 5 or 6 plus, Wax only a framework to bridge your native code and Lua code. 实际上,Wax不支持iPhone4或5或6或更高版本,Wax仅是桥接本机代码和Lua代码的框架。 Wax doesn't care about the device type or iOS SDK version. Wax不在乎设备类型或iOS SDK版本。

The following code just call UIScreen's method from ObjC Runtime, 以下代码只是从ObjC运行时调用UIScreen的方法,

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. 因此,如果您没有做任何事情来改变Wax的原点逻辑,那么我敢肯定,无论代码是本机代码还是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. 由于Wax框架不再保持如此长时间,因此我建议也使用JSPatch代替它。

Maybe you give more code we can find out where goes wrong. 也许您提供更多代码,我们可以找出问题出在哪里。

I believe it's to do with the difference between points and pixels. 我相信这与点和像素之间的差异有关。

See That's the difference between points and pixels. 请参见这就是点和像素之间的差异。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM