Jürgen Paul
Jürgen Paul

Reputation: 15017

Position window to the bottom right of the window?

How do I Position window to the bottom right of the window? I was thinking getting the max width and max height of the user's screen then subtracting a few pixels but I don't know how to do that.

Upvotes: 0

Views: 238

Answers (1)

Alex
Alex

Reputation: 1177

You can use the screen size (window.screen.width and window.screen.height) and the window size to calculate the wanted position of the top left corner of the window, and then place it there:

var app_window=Ti.UI.getCurrentWindow();
app_window.setX(window.screen.width-app_window.getWidth());
app_window.setY(window.screen.height-app_window.getHeight());

Upvotes: 1

Related Questions