如何为Tide Sdk应用程序窗口设置固定大小

How to set a fixed size for a Tide Sdk app window?

本文关键字:设置 窗口 应用程序 Tide Sdk      更新时间:2024-01-04

我正在尝试编译一个应用程序,它的窗口大小是固定的,无法缩放。我在API中找到了这些函数,但它们在编译时似乎不起作用-

var window = Ti.UI.currentWindow;
window.setHeight(500); // Set the window height to 800 pixels.
window.height = 500; // The same.
window.setMaxHeight(500);

您可以通过编辑tiapp.xml来解决这个问题,其中maxs和mins关闭宽度和高度。你也可以定义应用程序不会最大化或调整大小:

<width>700</width>
<max-width>700</max-width>
<min-width>700</min-width>
<height>500</height>
<max-height>500</max-height>
<min-height>500</min-height>
<fullscreen>false</fullscreen>
<resizable>false</resizable>
<maximizable>false</maximizable>
<minimizable>true</minimizable>

http://tidesdk.multipart.net/docs/user-dev/generated/#/guide/getting_started: