pref(rn): 优化全尺寸 linear-gradient 背景渲染时机 - #2521
Open
dos1in wants to merge 11 commits into
Open
Conversation
hiyuki
reviewed
Jul 1, 2026
Member
Author
valid-show-hide.mp4验证看起没问题,验证逻辑如下: |
hiyuki
reviewed
Jul 7, 2026
dos1in
marked this pull request as draft
July 9, 2026 09:04
Member
Author
|
ios 平台兼容性有问题,处理中。 |
dos1in
marked this pull request as ready for review
September 9, 2026 03:31
Collaborator
|
上面说的这个case确认过了吗?iOS下wx:show由false变为true后是否能够正常撑开渲染? |
Member
Author
iOS 渐变绘制链路存在问题,mpx层目前无法处理,现在方案是根据平台只给android/harmony 优化,验证 demo 如下: 父节点 wx:show + 子节点渐变背景、background-size: 100% 100% 的场景 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动说明
优化 RN 全尺寸
linear-gradient背景的首次渲染,避免无差别等待onLayout。100% 100%渐变使用四边撑满布局,直接渲染。例如容器宽度为
200、background-position: 20px 0时,渐变仍保持宽度200,向右偏移并裁剪,不会被left: 20; right: 0压缩成180。验证
react-native-linear-gradient 2.8.3原生源码和 Yoga 布局输出验证偏移;7 个用例归零、更新颜色后恢复像素一致。包含 1 个原 PR 对照用例,其恢复成功不代表偏移布局正确。useWrapImageHook,检查全尺寸、正负偏移、居中、对角及半尺寸等 7 种布局;自动和手动归零后均恢复显示。鸿蒙验证使用真实 React Hooks、RN 布局回调及宿主原生渐变组件,但不包含完整
.mpx页面编译和业务生命周期。三端验证均不作为首帧性能量化结果。平台截图
实际业务运行效果:
before.mp4
after.mp4