【问题标题】:How to make an app fit different phones如何让应用适合不同的手机
【发布时间】:2016-04-03 07:13:21
【问题描述】:

我在 LiveCode - 计算器中制作了一个应用程序。我是按照这些 (https://livecode.com/lessons/calculator/) 说明来做的,它被缩放以适合 iPhone。 我需要它来适应运行 Android 的不同手机(三星、GSmart、LG 等)。 我浏览了这个网站的大部分内容以及 LiveCode 论坛和帮助 (http://lessons.livecode.com/m/4071),没有关于 Android 手机的内容,只有 iOS 的东西。 我也试过了

on preOpenStack set the fullscreenmode of me to "exactFit" end preOpenStack

但我不知道它是否有效(尚未将其保存为独立应用程序,想先执行此操作)。

感谢您的回答。

【问题讨论】:

    标签: android livecode


    【解决方案1】:

    我有一台 Android 平板电脑和一部运行 Android 的廉价 LG 手机。在平板电脑上。我可以使用每种模式,但在手机上一个或多个不起作用。可能屏幕太小了。也许你遇到了同样的问题。您可以尝试不同的模式,例如信箱、noBorder 和 showAll。

    过去我有过必须让引擎抽卡才能设置the fullscreenMode的情况:

    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 版本是否仍然有用。

    另一个解决方案是 set the rect of the stack to the 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-17
      • 1970-01-01
      • 1970-01-01
      • 2016-07-18
      • 2014-03-11
      • 2021-05-22
      • 2018-10-06
      相关资源
      最近更新 更多