swift - 如何为 macOS 创建 float 搜索框

标签 swift macos

如何像 Spotlight 和 Alfred 一样使用 Swift 为 macOS 创建 float 搜索框?

Alfred search box

最佳答案

我们可以为此目的使用 ScalaFX

object Main extends JFXApp {
  val resource = getClass.getResource("/box.fxml")
  val root = FXMLView(resource, new GuiceDependencyResolver())

  stage = new PrimaryStage() {
    initStyle(StageStyle.Undecorated) // this option removes the default header
    title = "Cats"
    scene = new Scene(root)
  }
}

关于swift - 如何为 macOS 创建 float 搜索框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44421016/

相关文章:

ios - XCFramework生成时如何处理swift动态框架中的可选依赖

ios - Google Cloud Messaging iOS,接收多个通知

ios - 如何使用 NSURL :setResourceValues() in Swift 4. 1?

swift - 将 WebView 保存为 PDF 会返回空白图像吗?

macos - 无法让docker在Mac上工作

ios - 在 UIView 之间委派 - 将接收者的委托(delegate)放在哪里?

swift - 如何在单个 if 条件中使用可选的展开和 boolean 条件

c - 在磁盘上分配文件而不清零

c++ - 使用 C++ 捕获 MacBook Pro iSight 视频

c++ - Mac 上的 Qt::Sheet 和 QMessageBox::show()