Bad_Developer
Bad_Developer

Reputation: 537

Why my SwiftUI component has a circle-backslash?

I wanna make an iOS 14 widget which has a scrollview display some Text(). But when adding the SliderTitle() it's has a red circle-backslash inside like this:

enter image description here enter image description here What's wrong with my code? And why it's doesn't show full string even I set the lineLimit to nil

Upvotes: 0

Views: 200

Answers (1)

pawello2222
pawello2222

Reputation: 54466

This is because you can't use ScrollView in Widgets (you're not allowed to scroll anyway).

Widget views are static and they don't allow much interaction (with the exception of Link).

You need to replace the ScrollView with another container, eg. a HStack.

Upvotes: 1

Related Questions