Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
建立動畫圖片
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
除了錶面上的靜態圖片,動畫圖片還能為使用者體驗帶來更多樂趣。
請注意,本節專門介紹如何使用動畫圖片檔案。您可以使用 Transform 元素為錶面上的元件加上動畫效果,詳情請參閱「動態變更元素外觀」頁面。
動畫可以包含動畫圖片檔 (例如 GIF 動畫),也可以包含一系列 Images,這些 Images 會合併成動畫。
除了指定要使用的檔案,您還需要定義動畫的行為,例如是否要循環播放,如果不要,結尾要怎麼做等等。請使用 AnimationController。
最後,請在所有動畫中加入縮圖。
將這些內容整合在一起,即可實作基本動畫,如下所示:
<PartAnimatedImage x="0" y="0" width="450" height="450">
<AnimationController play="ON_VISIBLE"/>
<AnimatedImage resource="animation" format="AGIF"/>
<Thumbnail resource="animation_thumbnail" />
</PartAnimatedImage>
如要進一步瞭解如何加入動畫圖片清單,以及如何從靜態圖片建構動畫,請參閱 PartAnimatedImage 參考資料。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2026-05-11 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2026-05-11 (世界標準時間)。"],[],[]]