Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mobile LiveCode/RunRev如何根据显示大小调整堆栈大小_Mobile_New Operator_Livecode - Fatal编程技术网

Mobile LiveCode/RunRev如何根据显示大小调整堆栈大小

Mobile LiveCode/RunRev如何根据显示大小调整堆栈大小,mobile,new-operator,livecode,Mobile,New Operator,Livecode,我是一名新的livecode应用程序开发人员,正在开发一款需要多分辨率的移动应用程序 适合根据显示器的大小。但当我使用图像背景时,如果显示超出图像大小,它将显示空白 RunRev中是否有任何工具可以像android中的相对布局那样调整视图大小。要将图像对象的矩形设置为窗口的矩形,可以使用 set the rect of img "Your Image" to the rect of this cd 我不确定这是否足够。对于多分辨率,通常我会制作多个堆栈。您可能可以这样做: set the re

我是一名新的livecode应用程序开发人员,正在开发一款需要多分辨率的移动应用程序 适合根据显示器的大小。但当我使用图像背景时,如果显示超出图像大小,它将显示空白


RunRev中是否有任何工具可以像android中的相对布局那样调整视图大小。

要将图像对象的矩形设置为窗口的矩形,可以使用

set the rect of img "Your Image" to the rect of this cd
我不确定这是否足够。对于多分辨率,通常我会制作多个堆栈。您可能可以这样做:

set the rect of this stack to the screenRect
set the rect of img "Your Image" to the rect of this cd

请让我知道这是否解决了问题。

这里有一些问题需要考虑。

方向 纵横比 像素密度 计划A

要用一个图像处理这三种情况,我建议使用方形图像。将其大小设置为中等密度设备所需大小的两倍,达到您希望支持的大小,然后将其导入LiveCode。将resizeQuality设置为“好”,如果将其设置为“最佳”,则可能会有点慢,然后将其锁定位置设置为“真”。现在,将宽度和高度除以2,得到一个显示为其一半大小的图像。这将在高分辨率显示器上保持合理的质量。请记住,任何重要的东西都要以图像为中心,因为顶部和侧面将根据方向和纵横比被切断

下一步是resizeStack脚本,以确保图像按比例调整大小此脚本假定图像为方形:

on resizeStack
 lock screen
 if the height of this card > the width of this card then
    set the width of image "background" to the height of this card
    set the height of image "background" to the height of this card
 else
    set the width of image "background" to the width of this card
    set the height of image "background" to the width of this card
 end if
 set the loc of image "background" to the loc of this card
end resizeStack
方案B


使用重复模式并设置堆栈的背面模式。但是,内存使用量要低得多,在背景类型方面灵活性要低得多。

调整字段或按钮大小时,也不要忘记更改resizeStack处理程序中的文本大小

按比例:

put "1.25" into pScaleFactor
set the textSize of field "your field" to round(the textSize of field "your field" * pScaleFactor)
set the textHeight of field "your field" to round(the textHeight of field "your field" * pScaleFactor)

确切的:

if the height of this card > 640 then
set the textSize of field "your field" to "24"
set the textHeight of field "your field" to "26"
end if