[英]Formatting text in tableView Cell
我希望“ \\(category.questionCount)问题”文本正确对齐,而 “ \\(category.categoryName)> \\(category.subCategoryName)”文本向左对齐。
注意:在这种情况下,不确定是否需要左对齐。
cell.titleL?.text = "\(category.categoryName) > \(category.subCategoryName) \(category.questionCount) Questions"
您应该使用两个标签,而不是一个。 如果文本太长,则可以设置firstLabel.numberOfLines=0 ,将secondLabel对齐方式设置为right。
firstLabel.numberOfLines=0
[英]Multi-Line TableView Cell with Text Formatting
[英]How to assign text to cell in tableView?
[英]Correctly wrap text in tableview cell
[英]attributed text not working on TableView Cell
[英]How to alter tableview cell text?
[英]How to set the text and detail text of cell in tableview?
[英]UIButton inside tableview cell change text
[英]custom tableview controller's cell text
[英]UiButton text wont stay changed in Tableview cell
[英]How to align text in tableview cell in swift ios
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.