Reputation: 21
What i Need to do for our project is to Display several UIScrollViews in a View and weithin the scrollView a Headline and a Short Text.
I Know how to add a Label to the UIscrollview, but how Gould i handle the Case that the Headline-Label is too Long and wraps to a Second Line.
Upvotes: 2
Views: 746
Reputation: 135550
You can determine the space needed for the headline text by calling -[NSString sizeWithFont:]
or one of its variants. Then size and position the labels dynamically in your code (and set their numberOfLines
property to 0
).
Alternatives:
UIWebView
to display formatted text (HTML).[NSString drawAtPoint:withFont:]
).Upvotes: 4