ios - Truncate NSString to fit particular rect area -


In one of my applications, I want to show the short version of the comment after the ellipses.

If we use UILBL, then it can be done easily because the UILB itself does it. But I'm showing this comment in STTweetLabel which does not automatically So I have to minimize the string and put the text set in STTetLabel.

I came to the function to shrink NSString according to the specific width, but I am unable to shorten the string to capture the specified reset area to specify it.

Say that I have posted a comment in (320, 100)

"This is a very long comment and I want to shorten it in 4 lines and then with oval. To fit it in the specified width, but having problems with filtering it in the specified region, please help me to get the necessary behavior. "

In the frame below it (320,70) Should show "This is a very long comment and I I want to translate it into 4 lines and then want to be oval. I can shorten it to fit in a specific width, but it can get issues with filtering it in specified text. "

Is there a way to shorten NSString in the specified reset area?


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -