我用 LiveCode 制作了一个应用程序 - 计算器。我是按照这些 (https://livecode.com/lessons/calculator/) 说明来做的,它被缩放以适合 iPhone。 我需要它来适应运行 Android 的不同手机(三星、GSmart、LG 等)。 我浏览了这个网站的大部分内容以及 LiveCode 论坛和帮助 (http://lessons.livecode.com/m/4071),其中没有关于 Android 手机的内容,只有 iOS 的内容。 我也试过了
在 preOpenStack 上
将我的全屏模式设置为“exactFit”
结束 preOpenStack
但我不知道它是否有效(还没有将其保存为独立应用程序,想先这样做)。
感谢您的回答。
最佳答案
我有一台 Android 平板电脑和一部运行 Android 的廉价 LG 手机。在平板电脑上。我可以使用每种模式,但在电话上,一种或多种模式不起作用。可能是屏幕太小了。也许您遇到了同样的问题。您可以尝试不同的模式,例如 letterbox、noBorder 和 showAll。
过去,我遇到过在设置全屏模式
之前必须让引擎绘制卡片的情况:
on openStack
send "initializeStack" to me in 0 millisecs
pass openStack
end openStack
on initializeStack
set the fullscreenMode of this stack to "exactFit"
end initializeStack
我不知道这对最新的 8.x 版本是否仍然有用。
另一种解决方案是将堆栈的 rect 设置为 screenRect
并添加一个脚本来调整每个对象的位置,例如如果您有一个 field 1
,您的脚本中将包含以下内容:
on initializeStack
set the rect of this stack to the screenRect
put the rect of this cd into myRect
add 4 to item 1 of myRect
add 4 to item 2 of myRect
subtract 4 from item 3 of myRect
subtract 4 from item 4 of myRect
set the rect of fld 1 to myRect
end initializeStack
关于android - 如何让一个应用适合不同的手机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36382618/