渲染
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您的应用有一个重要的方面会影响用户对质量的感知,那就是应用将图片和文字渲染到屏幕上的流畅度。当应用正在绘制到屏幕时,务必要避免出现卡顿和响应迟缓的情况。
本部分介绍了几种优化应用渲染性能的方法:减少过度绘制、优化视图层次结构以及利用 GPU 分析工具。请参阅 Jetpack Compose 性能以了解 Jetpack Compose 中的渲染功能。
渲染操作
-
减少过度绘制
-
尽可能减少应用在单帧中重新绘制同一像素的次数。
-
性能和视图层次结构
-
确保您的布局和测量值能够高效执行,并避免 Double Taxation。
-
使用 GPU 渲染模式分析工具进行分析
-
利用该设备端工具找出可能减慢应用渲染速度的瓶颈。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-01-09。
[null,null,["最后更新时间 (UTC):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."]]