動畫預覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android Studio 可讓您透過「動畫預覽」檢查動畫。如果在組件預覽中描述了某個動畫,您可以檢查指定時間內各動畫值的確切值、暫停動畫、迴圈播放動畫、快轉動畫,或慢速播放動畫,以便對整個動畫的轉換過程進行偵錯:

此外,您也可以透過「動畫預覽」繪制動畫曲線圖,這有助於確保動畫值的編排妥善無誤:

「動畫預覽」會自動偵測可檢查的動畫,偵測到的項目會以「開始預覽動畫」圖示
標示。

如果您有多個動畫,可以使用「動畫預覽」一次檢查並協調所有動畫。也可以凍結特定動畫。

使用挑選器將非列舉或布林值狀態設為精確輸入,以偵錯 Compose 動畫。您可以播放、暫停、拖曳、控制速度及協調所有支援的 Compose 動畫 API。

「動畫預覽」目前支援 updateTransition
、AnimatedVisibility
、animate*AsState
、CrossFade
、rememberInfiniteTransition
和 AnimatedContent
API。如要使用最新功能,請搭配 Android Studio Narwhal 功能推送和 compose.animation
1.9.0 以上版本,使用動畫預覽功能。
為您推薦
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-08-21 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-21 (世界標準時間)。"],[],[],null,["# Animation Preview\n\nAndroid Studio allows you to inspect animations from Animation Preview. If an\nanimation is described in a composable preview, you can inspect the exact value\nof each animated value at a given time, pause the animation, loop it,\nfast-forward it, or slow it, to help you debug the animation throughout its\ntransitions:\n\nYou can also use Animation Preview to graph visualize animation curves, which is\nuseful for making sure that the animation values are choreographed properly:\n\nAnimation Preview automatically detects inspectable animations, which are\nindicated by the **Start Animation Preview** icon\n.\n\nIf you have multiple animations, you can use Animation Preview to inspect and\ncoordinate them all at once. You can also freeze a specific animation.\n\nUse pickers to set non-enum or boolean states to debug your Compose animation\nusing precise inputs. For all supported Compose Animation APIs, you can play,\npause, scrub, control speed, and coordinate.\n\nAnimation Preview currently supports the\n[`updateTransition`](/reference/kotlin/androidx/compose/animation/core/package-summary#updateTransition(kotlin.Any,kotlin.String)),\n[`AnimatedVisibility`](/reference/kotlin/androidx/compose/animation/package-summary#AnimatedVisibility(androidx.compose.animation.core.MutableTransitionState,androidx.compose.ui.Modifier,androidx.compose.animation.EnterTransition,androidx.compose.animation.ExitTransition,kotlin.String,kotlin.Function1)),\n[`animate*AsState`](/develop/ui/compose/animation#animate-as-state),\n[`CrossFade`](/develop/ui/compose/animation#crossfade),\n[`rememberInfiniteTransition`](/develop/ui/compose/animation#rememberinfinitetransition),\nand [`AnimatedContent`](/develop/ui/compose/animation#animatedcontent)\nAPIs. To access the latest features, use Animation Preview with\nAndroid Studio Narwhal Feature Drop and `compose.animation` 1.9.0 and higher.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Animations in Compose](/develop/ui/compose/animation/introduction)\n- [Animation tooling support {:#tooling}](/develop/ui/compose/animation/tooling)\n- [Value-based animations](/develop/ui/compose/animation/value-based)"]]