Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将窗口定位到窗口的右下角?我正在考虑获取用户屏幕的最大宽度和最大高度,然后减去几个像素,但我不知道该怎么做。
您可以使用屏幕大小(window.screen.width和window.screen.height)和窗口大小来计算窗口左上角的所需位置,然后将其放置在那里:
window.screen.width
window.screen.height
var app_window=Ti.UI.getCurrentWindow(); app_window.setX(window.screen.width-app_window.getWidth()); app_window.setY(window.screen.height-app_window.getHeight());