Search code examples
javascriptwindowscalefixedtidesdk

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


I am trying to compile an app, that would have a fixed window size, one that could not be scaled. I found these functions in the API, but they don't seem to work when compiling -

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

Solution

  • You could solve this by just editing the tiapp.xml with maxs and mins closing the width and height. You can also define that the app doesn't maximize or resize:

    <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: