Skip to content

pref(rn): 优化全尺寸 linear-gradient 背景渲染时机#2521

Open
dos1in wants to merge 1 commit into
didi:masterfrom
dos1in:pref/rn-gradient-image
Open

pref(rn): 优化全尺寸 linear-gradient 背景渲染时机#2521
dos1in wants to merge 1 commit into
didi:masterfrom
dos1in:pref/rn-gradient-image

Conversation

@dos1in

@dos1in dos1in commented Jun 11, 2026

Copy link
Copy Markdown
Member

默认全尺寸的渐变色 linear-gradient 无差别等待 onLayout 导致首帧显示变慢,做了以下优化:

  • 对归一化为 100% 100% 的 linear-gradient 背景跳过 layout 等待
  • layout 尺寸未就绪时使用 StyleSheet.absoluteFillObject 直接铺满全尺寸渐变
  • 保留非全尺寸 background-size、background-position 和对角渐变的原有 layout 路径
before.mp4
after.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant