Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function backgroundSize (imageProps: ImageProps, preImageInfo: PreImageInfo, ima
} else { // 数值类型 ImageStyle
// 数值类型设置为 stretch
imageProps.resizeMode = 'stretch'
if (type === 'linear' && (!layoutWidth || !layoutHeight)) {
if (type === 'linear' && (!layoutWidth || !layoutHeight) && (isPercent(width) || isPercent(height))) {
// ios 上 linear 组件只要重新触发渲染,在渲染过程中外层容器 width 或者 height 被设置为 0,通过设置 % 的方式会渲染不出来,即使后面再更新为正常宽高也渲染不出来
// 所以 hack 手动先将 linear 宽高也设置为 0,后面再更新为正确的数值或 %。
dimensions = {
Expand Down