Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify text in SwiftUI

If I changed the content of Text in SwiftUI, the text got stretch/truncated.

For example, let's say we changed the Text from "World" to "SwiftUI", we got the result as shown. How do we prevent this to happened?

Text got stretched in SwiftUI

like image 689
Lim Thye Chean Avatar asked Oct 23 '25 17:10

Lim Thye Chean


1 Answers

Your code is working fine, it's probably a bug when you're previewing the app. If you actually run the app on a simulator you will see the text updating correctly. Hopefully it will be fixed in the next Xcode 11 beta releases.


Update: This issue was fixed with Xcode 11 beta 2.

like image 142
M Reza Avatar answered Oct 26 '25 08:10

M Reza



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!