我到處搜索如何使瀏覽器窗口的圓角變圓。如何在電子browserWindow中創建圓角?
如何實現圓角?
我試過讓它透明。但沒有任何工作。
赫斯我的代碼:
/**
* we need to keep a global reference of the window object. If we don't, the
* window will be closed automatically when the js object is garbage collected
*/
let win
function createWindow() {
// Create the browser window.
win = new BrowserWindow({
width: 1800,
height: 1000,
frame: false,
transparent: true,
icon: __dirname + 'icon.png'
})
// and load the index.html of the app.
win.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}))
// Open the DevTools.
win.webContents.openDevTools()
// Emitted when the window is closed.
win.on('closed', function() {
/**
* Dereference the window object, usually you would store windows in an
* array if your app supports multi windows, this is the time when you
* should delete the corresponding element.
*/
win = null
})
}
'框架:假的,半徑:[5,5,5,5]'是我看過。 – scoopzilla
添加了哪裏? @scoopzilla – WorldWideBangers
@scoopzilla它不起作用 – WorldWideBangers