问题描述
当我在Google和StackOverflow中搜索相当于iOS的Android TextView"时,我希望能找到一个快速的答案,但是它花了一些时间来搜索和切换关键字.我正在发布此问答集,以便其他人可以快速找到这些关键字.
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.
我从事Android编程已有大约一年的时间,现在我开始使用iOS.我一直在做的所有教程都使用 UILabel
来显示文本,但是我希望多行文本可能长一些段落,而UILabel似乎不适合该文本.
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.
这个问题出现了,但这是错误的方向(iOS到Android)
This one came up, but that was the wrong direction (iOS to Android):
还有其他一些等效"问题,但不是我想要的:
And here are some other "equivalent" questions but not the one I wanted:
- 什么是Android的"Spannable";在Objective-C中
- 相当于Android内容提供商在iOS?
- 相当于iOS中的Android权限发展吗?
- 相当于Android的Html.fromHtml()在iOS中?
推荐答案
iOS中与Android TextView
等效的是 UILabel
和 UITextView
.您想要大量文本的是 UITextView
.以下是对文档的说明:
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:
以下是一些进一步研究的链接:
Here are some links for further research:
- Using Text Kit to Draw and Manage Text (documentation)
- Text Kit Tutorial in Swift
- Using Text Kit to Manage Text in Your iOS Apps
- ios: best way to display variable-length, multi-line text
这篇关于相当于iOS中的Android TextView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!