为什么堆栈大小不能自动适应设备屏幕? - 动态代码

时间:2014-06-02 03:48:02

标签: livecode

大家

我创建的堆栈大小为768 * 1024.这个尺寸适用于iPad或iPad Retina。我的图像大小为768 * 1024。

我在模拟器上测试过。我的图像不适合。图片如下。

enter image description here

此代码:

on preOpenstack
   if the environment is "mobile" then
      set the acceleratedRendering of this stack to true
   end if
   set the fullScreenMode of this stack to "exactFit"
   put the short name of the first grp into grpname
   set the layerMode of group grpname  to "scrolling" 
end preOpenstack

我设置尺寸和位置跟随此。

enter image description here

我该怎么办?

谢谢。

对不起。我的英语不好。

1 个答案:

答案 0 :(得分:0)

这不起作用的原因是因为您的脚本中有错误。要在运行时收到此类错误的通知,请将以下脚本添加到堆栈脚本中:

on errorDialog pError
   answer pError
end errorDialog

这样的事情会出现在屏幕上:

87,7,22
77,8,22
449,8,4,scrolling
...
...

键号为“7”。第1行的第二项告诉您脚本的行号是否会引发运行时错误。

对于你的脚本,你得到的是你的组的短名称,它返回“group ID xx”,因为你没有命名该组。所以在以下行中:

set the layerMode of group grpname  to "scrolling" 

你实际上正在执行:

set the layerMode of group group id xx to "scrolling"

因为正在获取第一个组的短名称...您可以通过直接在组上设置layerMode属性来解决此问题,如下所示:

set the layerMode of group 1 to "scrolling"
相关问题