【问题标题】:How to handle iPhone screen sizes with MergAV如何使用 MergAV 处理 iPhone 屏幕尺寸
【发布时间】:2018-02-12 08:57:45
【问题描述】:

我正在尝试使用 MergAV 构建一个小型 iOS 应用程序来扫描二维码。唯一困扰我的是,如果我创建基于 iPhone 5 屏幕尺寸的应用程序,一切正常。即使在更大的屏幕上!但如果我从 iPhone 6 大小的堆栈开始,我需要添加:

set the fullscreenmode of this stack to "ShowAll"

否则,iPhone 6 或 7 上的堆栈会很大。这本身很奇怪,但可以管理。在我的堆栈上方的行告诉 scaleFactor 是 1 并且 systemPixelScale 是 2(如预期的那样)但是当我通过以下方式设置“相机”的矩形时:

mergAVCamSet "rect",the rect of grc "cam"

相机没有得到正确的矩形。它略微向左下方偏移并且高于原始矩形。另一方面,如果我通过mergAVCamGet("rect") 查询图形的矩形和相机的矩形,前三个数字相同,但最后一个(底部值)不同,并且凸轮实际上有一个较小的数字!

这是一个错误吗?我应该知道什么?有什么可以解决的吗?

【问题讨论】:

    标签: ios external livecode


    【解决方案1】:
    function realDeviceSize pParam
       local nX, nY
       put item 3 of the screenRect / item 3 of the effective rect of this stack into nX
       put item 4 of the screenRect / item 4 of the effective rect of this stack into nY
       put the round of (item 1 of pParam * nX) into item 1 of pParam
       put the round of (item 2 of pParam * nY) into item 2 of pParam
       put the round of (item 3 of pParam * nX) into item 3 of pParam
       put the round of (item 4 of pParam * nY) into item 4 of pParam
       return pParam
    end realDeviceSize
    
    on preOpenCard
       put realDeviceSize(the rect of image "iRectangle") into tCameraRect
    end preOpenCard
    

    【讨论】:

    • 请添加一些解释,而不仅仅是一段代码。
    猜你喜欢
    • 2014-11-25
    • 2012-10-13
    • 2015-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多