對話方塊
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
使用 Dialog
可讓使用者註意需及時操作的動作或資訊上。

圖解
對話方塊應用於回應使用者工作或動作,並提供相關及相對資訊。與行動裝置版的做法不同,Wear OS 中的對話方塊會佔用整個螢幕,並疊加在其他內容上。
對話方塊支援滑動關閉手勢。當使用者執行此滑動手勢時,系統會在背景顯示父項內容。
對話方塊提供單一對話方塊版位,例如
快訊或確認。
快訊
使用快訊元件取得使用者對重要任務的回應。
快訊到期時,所有應用程式功能都會停用,並會持續顯示於螢幕上,直到您採取行動為止。快訊可能會造成乾擾,因此請謹慎使用。
如果快訊的內容超過三行文字,請考慮將內容靠左對齊,以方便閱讀。否則文字會預設為置中對齊。
A. 標題
B. 內容 (選用)
C. 否定鈕
D. 確認鈕
E. 圖示 (選擇性)
確認
確認元件會在短時間內向使用者顯示確認訊息。與 Material 對應的應用程式不同,Wear OS 中的確認元件無法讓使用者做出選擇的最終確認。
您可以利用這個元件,在使用者執行動作後吸引他們的注意。
A. 圖示
B. 標籤
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Dialogs\n\nUse a [`Dialog`](/reference/kotlin/androidx/wear/compose/material/dialog/package-summary) to focus users' attention on a timely action or piece of\ninformation.\n\nAnatomy\n-------\n\n\nDialogs should appear in response to a user task or an action, with\nrelevant or contextual information. Unlike their mobile counterparts,\nDialogs in Wear OS occupy the whole screen and are layered over other\ncontent.\n\n\nDialogs support a swipe-to-dismiss gesture. When the user performs\nthis swipe gesture, the system reveals the parent content in the\nbackground.\n\nDialogs have a single slot for opinionated dialog content, such as an\n[Alert](/reference/kotlin/androidx/wear/compose/material/dialog/package-summary#Alert(kotlin.Function1,kotlin.Function0,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function1,androidx.wear.compose.material.ScalingLazyListState,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.PaddingValues,kotlin.Function1)) or\n[Confirmation](/reference/kotlin/androidx/wear/compose/material/dialog/package-summary#Confirmation(kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function1,androidx.wear.compose.material.ScalingLazyListState,kotlin.Long,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.PaddingValues,kotlin.Function1)).\n\n\u003cbr /\u003e\n\n\n**Alert**\n\nUse an alert component to get the user's response for important\ntasks.\n\nAlerts disable all app functionality when they appear, and remain on\nscreen until an action has been taken. Alerts are purposefully interruptive,\nso use them sparingly.\n\nIf the content of the alert is longer than three lines of text, consider\nleft aligning the content to improve its readability. Otherwise the text\nis center aligned by default.\n\n\n**A. Title\nB. Content (optional)\nC. Negative button\nD. Positive button\nE. Icon (optional)**\n\n\u003cbr /\u003e\n\n**Confirmation**\n\nThe confirmation component displays a confirmation message to the user\nfor a short period of time. Unlike its Material counterpart, the\nconfirmation component in Wear OS doesn't allow users to provide final\nconfirmation of a choice.\n\nUse this component to capture a user's attention after an action has been\nexecuted.\n\n\n**A. Icon\nB. Label**"]]