如何将文本添加到标签或表格 View ,而不是更新标签/表格 View ?
var personArray: [Person] = [
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 = ""
}
}
thePeople.text = thePeople.text+"NewText"
或更短
thePeople.text += "NewText"
关于ios - 在 Swift 中将文本添加到 textview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26968219/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |