When creating a new tableview with a single label, the label is being cut off and I cannot seem to increase the size of the cell to accommodate it. I would like to just have a fixed vertical size on the cell. I have tried so many different UI settings nothing seems to work and it seems simple. Here is what it looks like:
Here is what it looks like in design:
You have multiple options to fix this. I have listed them below.
Autoshrink
property. It can be set to Minimum Font Scale
and Minimum Font size
您应该尝试使用自动autodimension
来确定单元格大小
The solution used was this:
override func viewDidLoad() {
super.viewDidLoad()
self.eventCategoryListTableView.rowHeight = UITableView.automaticDimension
}
In addition to this code above you have to make sure to set top, bottom, and height constraints for the label.
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.