算繪
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
應用程式的一大重點在於讓使用者能在螢幕上看到圖片和文字,是影響使用者感受品質的重要一環。在應用程式繪製螢幕畫面時,請務必避免出現卡頓和回應遲緩的情形。
本節說明幾種最佳化應用程式轉譯效能的方法:減少過度繪製、最佳化檢視區塊階層,以及善用剖析 GPU 工具。如要瞭解 Jetpack Compose 中的轉譯作業,請參閱「Jetpack Compose 效能」。
轉譯操作
-
減少過度繪製
- 盡量減少應用程式在單一影格中重複繪製同一個像素的次數。
-
效能與檢視區塊階層
-
確保版面配置和測量作業都能有效率地執行,避免發生重複作業。
-
使用剖析 GPU 轉譯進行分析
- 善用這項裝置端工具,找出可能拖慢應用程式轉譯速度的瓶頸。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2024-01-09 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2024-01-09 (世界標準時間)。"],[],[],null,["# Rendering\n\nA key aspect of your app that influences your users' perception of quality is the smoothness with\nwhich it renders images and text to the screen. It's important to avoid jank and sluggish\nresponsiveness when your app is drawing to the screen.\n\nThis section shows several ways to optimize your app's rendering performance: reducing overdraw,\noptimizing view hierarchies, and taking advantage of the Profile GPU tool. See\n[Jetpack Compose performance](/jetpack/compose/performance) to learn about rendering in\nJetpack Compose.\n\nRender actions\n--------------\n\n\n**[Reduce overdraw](/topic/performance/rendering/overdraw)**\n:\n Minimize the number of times your app redraws the same pixel in a single frame.\n\n\n**[Performance and view hierarchies](/topic/performance/rendering/optimizing-view-hierarchies)**\n:\n Make sure your layout and measurement are executing efficiently, and avoid double taxation.\n\n\n**[Analyze with Profile GPU Rendering](/topic/performance/rendering/profile-gpu)**\n:\n Take advantage of this on-device tool to identify bottlenecks that might slow your app's\n rendering."]]