|
Subscript character are cut like this: How could I dynamically add some height points to the Text element AFTER he loaded the text (because the text lines are very variables in number)? Buttons are declared like this:
|
|
|
|
I tried but it gives the same result. It seems like SwiftUI does not calculate the subscript character space. I tried also
But it doesn't work and moreover it gives me unexpected behaviours (like ignoring the |
|
I believe that you need to put an offset after font size.
For a more general view I have replaced some of your button specific details to make a generic view.
|
|
Also with the offset it doesn't work. The offset moves the Text view but the subscript character remains cut. I think that the solution could be getting the initial height of the Text view by a GeometryReader and sum about 3 points but I don't know how to do it |
|
OK, I think your padding is in the wrong place, as you are padding out the ZStack, rather than the HStack. You could try
|
|
I just tried but this not solved It's not about spacing, also because if I put long text inside the button all works fine |
|
|
|
|
SPONSORED Check out Stream's cross-platform open source chat SDK on GitHub! Write once and deploy your app with fully featured chat UI on iOS and macOS.
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.