android - 如何让一个应用适合不同的手机

标签 android livecode

我用 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/

相关文章:

java - 从方法中获取 String 或 Int 并将其发送到另一个 Activity

android - 如何在 Android Studio 3.0.0 中使用数据绑定(bind)和 Kotlin

ios - 如何使用LiveCode字段计算selectedText的位置?

audio - 声音剪辑在LiveCode中不起作用

audio - mergExt-避免播放音频停止mergAVCamSet

android - 如何对像whatsapp这样的android通知进行分组?

android - 在 ListView 中回收 View ,值得吗?

android - 在android中为按钮制作按下效果

安卓下拉菜单

ios - 为 iOS 构建独立的 livecode 错误 : There was an error while saving the standalone application linking for armv7 failed with Id: