ios - 在 Swift 中将文本添加到 textview
<p><p>如何将文本添加到标签或表格 View ,而不是更新标签/表格 View ?</p>
<pre><code>var personArray: = [
Person(name: "Heine", sex: "Guy"),
Person(name: "Magnus", sex: "Girl"),
Person(name: "Sarah", sex: "Girl")
]
@IBOutlet weak var thePeople: UILabel!
func updatePeople()
{
for peop in personArray{
thePeople.text = ""
}
}
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code>thePeople.text = thePeople.text+"NewText"
</code></pre>
<p>或更短</p>
<pre><code>thePeople.text += "NewText"
</code></pre></p>
<p style="font-size: 20px;">关于ios - 在 Swift 中将文本添加到 textview,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/26968219/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/26968219/
</a>
</p>
页:
[1]