Tauri 初始屏幕 設(shè)置

2024-01-29 16:19 更新

首先,在 ur 中創(chuàng)建一個(gè)包含初始屏幕的 HTML 代碼。然后,更新您的喜好:splashscreen.htmldistDirtauri.conf.json

"windows": [
  {
    "title": "Tauri App",
    "width": 800,
    "height": 600,
    "resizable": true,
    "fullscreen": false,
+   "visible": false // Hide the main window by default
  },
  // Add the splashscreen window
+ {
+   "width": 400,
+   "height": 200,
+   "decorations": false,
+   "url": "splashscreen.html",
+   "label": "splashscreen"
+ }
]

現(xiàn)在,您的主窗口將被隱藏,并且啟動(dòng)應(yīng)用程序時(shí)將顯示初始屏幕窗口。接下來,你需要一種方法來關(guān)閉初始屏幕,并在應(yīng)用準(zhǔn)備就緒時(shí)顯示主窗口。如何執(zhí)行此操作取決于在關(guān)閉初始屏幕之前要等待的內(nèi)容。


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)