【问题标题】:Move the BrowserWindow to the bottom right将 BrowserWindow 移动到右下角
【发布时间】:2018-08-27 12:21:30
【问题描述】:

请问有没有动态设置位置或者将浏览器窗口移到右下角的方法?

BrowserWindow.setPosition(x, y)

【问题讨论】:

    标签: javascript jquery electron


    【解决方案1】:

    您可以使用the screen API,并使用固定的 with 来偏移屏幕边缘:

    let display = electron.screen.getPrimaryDisplay();
    let width = display.bounds.width;
    win = new BrowserWindow({
      width: 600,
      x: width - 600,
      y: 0
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-04
      • 1970-01-01
      • 2020-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-08
      相关资源
      最近更新 更多