Lim Thye Chean
Lim Thye Chean

Reputation: 9434

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

Upvotes: 4

Views: 1854

Answers (1)

M Reza
M Reza

Reputation: 19698

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.

Upvotes: 6

Related Questions