【发布时间】:2017-06-05 23:02:55
【问题描述】:
我到处搜索如何使浏览器窗口的角变圆。
如何实现圆角?
我试过让它透明。但没有任何效果。
她的我的代码:
/**
* 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
})
}
【问题讨论】:
-
frame: false, radii: [5,5,5,5]是我读到的。 -
这是在哪里添加的? @scoopzilla
-
@scoopzilla 它不起作用
标签: javascript html css window electron