简体   繁体   中英

What is the equivalent of Android TextView in iOS?

When I searched for "Android TextView equivalent in iOS" in Google and StackOverflow I expected to find a quick answer but it took a little searching and switching up of keywords. I am posting this Q&A pair so that other people can have the quick answer for these keywords.

I've been doing Android programming for about a year and now I am starting on iOS. All of the tutorials I've been doing use UILabel to display text but I want multiline text that could be paragraphs long and UILabel doesn't seem suited to that.

This one came up, but that was the wrong direction (iOS to Android):

iOS to Android: How to display a TextView

And here are some other "equivalent" questions but not the one I wanted:

The equivalent of an Android TextView in iOS is UILabel and UITextView . The one you want for large amounts of text is UITextView . Below are descriptions taken from the documentation:

UITextView

The UITextView class implements the behavior for a scrollable, multiline text region. The class supports the display of text using custom style information and also supports text editing. You typically use a text view to display multiple lines of text, such as when displaying the body of a large text document.

UILabel

The UILabel class implements a read-only text view. You can use this class to draw one or multiple lines of static text, such as those you might use to identify other parts of your user interface.

UITextField

A UITextField object is a control that displays editable text and sends an action message to a target object when the user presses the return button. You typically use this class to gather small amounts of text from the user and perform some immediate action, such as a search operation, based on that text.

Here are some links for further research:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM