javascript - How to make window size responsive in Electron. (On the opening of the app)
问题描述
I recently started making an app on Electron, I wanted to make the window responsive, for example, if I open app on different screens it should open in full-size according to the screen size.
my code:
app.on('ready', () => {
const htmlPath = path.join('src', 'html/login.html')
mainWindow1 = new BrowserWindow({ width: 1000 , height: 1000})
mainWindow1.loadFile(htmlPath)
})
Please help me with this.
解决方案
创建你的后BrowserWindow
,你应该打电话maximize()
mainWindow1 = new BrowserWindow();
mainWindow1.loadFile(htmlPath);
mainWindow1.maximize();
推荐阅读
- r - Anaconda R 和 R 基金会的 R 有什么区别?
- unix - tSytsem 组件转义字符问题
- python - 在 Django urls.py 中创建等效路径
- python - 如何将字符串列表转换为 int 列表?
- ruby - GitHub 操作无法安装 gem
- sql - 将 Null 计数显示为 0 PSQL
- android - 将深度传感器的图像放在主摄像头的原始图像之上
- eclipse - 安装了 Cucumber 插件,但功能文件在 Eclipse 中的普通文本编辑器中打开
- sockets - Windows 套接字接受()不返回
- reactjs - 在 JSX 和 HTML 的组合中给出 [object Object]