Now, I have one UITableviewCell like this:
|--------------------|
| TitleLabelxxxxxx |
| SubtitleLabelxxx |
| tagView(Labels ) |
|____________________|
Tagview : https://github.com/ElaWorkshop/TagListView
TitleLabel and subtitleLabel are not one line.
I receive data from the backend and set the data to tagViews, titleLabel and subtitleLabel.
I used a storyboard to make this TableviewCell.
I used autoLayout to preset the height of the Tagview.
The value of height is more than or Equal
34( one line height).
If the tagViews has one line label, the TableviewCell renders perfectly.
If the tagViews has several tags:
When the TableviewCell first shows, the TableviewCell does not render all tags which are rendered in the tagView.
When I scroll this tableView, all TableviewCell will render perfectly after they scroll into the screen.
I used the tableView.rowHeight = UITableView.automaticDimension
to set the height of TableviewCell.
This way can't calculate the perfect height value when the cell first renders.
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.