Xcode & Swift - Window without title bar but with close, minimize and resize buttons

后端 未结 7 2175
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 17:29

I am currently using Swift in Xcode 6, Beta 5. I am trying to remove the title bar, or any visible difference between the title bar and the actual content. If I enable \"Uni

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-22 17:58

    Since MacOS X 10.10, you can use these:

    if #available(macOS 10.10, *) {
        window.titlebarAppearsTransparent = true
    }
    
    if #available(macOS 10.2, *) {
        window.movableByWindowBackground  = true
    }
    

    There was an official sample project for window appearance in Yosemite. You might wanna check it out.

提交回复
热议问题