خرید بک لینک

Vote count: 1

Building on Xcode 7.2.1, iOS 9.2

I have a UITableView, with cells that have have automatic height.

self.tableView.estimatedRowHeight = 80
self.tableView.rowHeight = UITableViewAutomaticDimension

The cells have 6 label/value pairs in them -- [Label X: Value]. Each label/value pair is comprised of 2 UILabels, with their content hugging and content compressions resistance attributes set accordingly to give the desired look.

However, sometimes the cell height properly measures itself, and other times adds a bunch of extra space (interesting enough the extra space is always equal to the space that would be there if the content compression/hugging wasn't added to either label).

Here's the inconsistency that happens:

Sometimes it's right: enter image description here

Sometimes it's wrong: enter image description here

When I remove the content compression/resistance from the labels however, the cell is always the correct height, but looks like this: enter image description here

Anybody experienced similar? Have any suggestions?

asked 4 mins ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: جمعه 14 اسفند 1394 ساعت: 4:12

صفحه بندی