Skip to content

Commit c8bd739

Browse files
wwwcgzealotchen0
authored andcommitted
fix(ios): layout issue of pure images nested in text scenarios
1 parent 2677c84 commit c8bd739

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

renderer/native/ios/renderer/component/text/HippyShadowText.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ - (void)updateAttachmentsFrame:(NSMutableSet<NativeRenderApplierBlock> * _Nonnul
266266
// if truncated or out of the display area, then we need to hide the attach view
267267
// {-1, -1} means attachment view has been truncated, ref: attachmentSizeForGlyphAtIndex api
268268
if ((isTruncated && CGSizeEqualToSize({-1, -1}, attachmentSize))
269-
|| location.x >= CGRectGetMaxX(lineRect) || location.y >= CGRectGetMaxY(lineRect)) {
269+
|| location.x >= CGRectGetMaxX(lineRect)
270+
// when there is no text, just image nested in text label,
271+
// location.y is equal to lineRect.maxY
272+
|| location.y > CGRectGetMaxY(lineRect)) {
270273
[blocks addObject:^(NSDictionary<NSNumber *, UIView *> *viewRegistry,
271274
UIView * _Nullable lazyCreatedView) {
272275
HippyView *view = (HippyView *)(lazyCreatedView ?: viewRegistry[child.hippyTag]);

0 commit comments

Comments
 (0)