Open sudachi808 opened 2 years ago
Use setContentCompressionResistancePriority
in order for the view to actually collapse. In your example, change the updateUIView to this:
func updateUIView(_ uiView: MarqueeLabel, context: Context) {
uiView.textAlignment = .center
uiView.text = "The quick brown fox jumps over the lazy dog."
uiView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
uiView.restartLabel()
}
I want to use MarqueeLabel within SwiftUI views. But I could not work it using the code below.
How do I implement it?