Closed chichkanov closed 2 months ago
The header text is wrapping when the header's container expands. See #14—dynamic header height isn't currently supported, so I'm labelling as an enhancement.
But the header content is static here, always two Texts.
Yeah, you're right. I reclassified this one as a bug.
It seems to be an issue with multi-line text in general. If you change the second text label to the following, it stops glitching out:
Group {
Text("Some long long description bla")
Text("second line of text bla bla bal")
}
.font(.callout)
.foregroundStyle(.secondary)
I'm worried this one might be a SwiftUI bug, but I haven't had time to dig in. If you find any clues about why the text is truncating, let me know.
Update: Revised workaround (2)—in my initial version I copy-pasted the wrong line of code.
I'm closing this one—it is most definitely a SwiftUI bug related to multi-line text rendering. The only thing that SwiftUIMaterialTabs does to your title view is expand the height by setting frame(height:)
when you pull the scroll up into negative content offset.
I have a couple of workarounds:
geometryGroup()
. I don't see any need for it here. This modifier was added as the result of one of my Radars, so I think I have a good handle on what problem it solves. But maybe you've found some specific uses for it that I'm not aware of?geomtryGroup()
with .transformEffect(.identity)
—it effectively accomplishes the same thing. This workaround was given to me by Apple when geomtryGroup()
was still a private API.Reopen if you think I've missed something.
Environment: iOS18, iPhone 16 pro max simulator. Latest main branch, commit bb97ec4
https://github.com/user-attachments/assets/62404d90-9f41-410b-9cd1-ac5ce6306d70
Code