const electron = require("electron");
const {app, BrowserWindow, globalShortcut} = electron;
const path = require("path");
function createWindow(){
win = new BrowserWindow({
width: 1000,
height: 750,
icon: path.join(__dirname,'\checked.png'),
frame: false,
fullscreenable:false,
// radii: [5,5,5,5],
// transparent:true
});
win.loadFile('mainWindow.html')
win.setMenu(null);
}
拐角处始终有白色边框,使其变为矩形。
曾尝试增加css的边框大小,但一切都会扩展。
答案 0 :(得分:1)
关键的属性是:frame: false
和transparent: true
(您错过了后者)
js
const {app, BrowserWindow} = require('electron')
const path = require('path')
app.once('ready', () => {
let win = new BrowserWindow({
frame: false,
transparent: true
})
win.loadURL(path.join(__dirname, '/roundedcorner.html'))
})
html
<html>
<body>
<p style="border-radius: 25px; background: #73AD21; height: 300px;"></p>
</body>
</html>