Titanium Desktop - 获取菜单栏图标位置

发布于 2024-11-25 11:26:29 字数 311 浏览 6 评论 0原文

我正在尝试创建一个应用程序,其中仅在单击菜单栏图标时才显示主窗口。我已经创建了菜单栏图标,但我不知道如何将窗口放置在其下方。有没有办法获得它的x位置?

这是我的菜单栏图标的 javascript:

var win = Titanium.UI.getCurrentWindow();

var tray = Titanium.UI.addTray(
    "app://images/menubar.png",
    function(){ win.show(); }
);

单击菜单栏图标时显示窗口,但它显示在屏幕中央。

I am trying to create an app where the main window is shown only when the menubar icon is clicked. I have create the menubar icon but I can't figure out how to position the window underneath it. Is there a way to get the its x position?

This is my javascript for the menubar icon:

var win = Titanium.UI.getCurrentWindow();

var tray = Titanium.UI.addTray(
    "app://images/menubar.png",
    function(){ win.show(); }
);

This shows the window when the menubar icon is clicked, but it shows up in the center of the screen.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文