Questions tagged [uitableviewautomaticdimension]

UITableViewAutomaticDimension is a constant value that can be assigned to UITableView's rowHeight property to enable mechanism of automatic cell's height calculation. Use this tag in questions about self-sizing table view cells. Related tags are [tag:uitableview], [tag:tableviewcell] and [tag:autolayout]

Useful information about self-sizing table view cells can be found at the Apple's documentation. Basic steps are the following:

tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 85.0

Also, in each table view cell you need an unbroken chain of constraints and views (with defined heights) to fill the area between the content view’s top edge and its bottom edge. If your views have intrinsic content heights, the system uses those values. If not, you must add the appropriate height constraints, either to the views or to the content view itself.

estimatedRowHeight property could be emitted if you have table view's delegate and have implemented -tableView:estimatedHeightForRowAtIndexPath: method to return own value for each row. This method should be lightweight enough to have minimal impact for main thread efficiency. Here you still can return UITableViewAutomaticDimension constant.

140 questions
0
votes
1 answer

Dynamice tableview Cell with Addsubview

I need to add multiple checkbox in my tableview cell , so that cell size automatically increase as per number of checkbox buttons at runtime. How can I do it ? My custom cell import UIKit class checkboxCell: UITableViewCell { @IBOutlet weak…
9to5ios
  • 5,319
  • 2
  • 37
  • 65
0
votes
1 answer

UItableView automaticDimension not working with UIStackView

I want that my UITableViewCell calculates properly its height so its bottom matches the UIStackView bottom. I have an understanding that for UITableView.automaticDimension to work you need to set all the vertical constraints of the UITableViewCell…
0
votes
1 answer

Async height change for UITableViewCell

In one of my projects, I need to change the height of UIImageView in UITableViewCell according to image size, but the problem is that sometimes I have to do this after the cell is already shown. So, my current solution works like a charm if I know…
lithium
  • 1,272
  • 1
  • 14
  • 28
0
votes
1 answer

Problem with adding NSLayout constraints programmatically

I'm having an issue with using greaterThanOrEqualTo constraint with my current project. What I need is making the height of the cell dynamic, so I need the title of recipes to be multi-lines based on what returns from the API, and make the favorite…
0
votes
1 answer

Multiple UITableViewCell problem in displaying

I'm new in autolayout programmatically, and I have a problem with displaying 2 different cells in UITableView as below: The first cell I want to show profiles picture and the username, then the menu options. But as screenshot the second section…
0
votes
1 answer

TableView cell not changing height while animating dropdown UIView

I have a UIView animating dropdown while tapping. what I want to achieve is, while UIView height changing when I tap the tableView cell automatically follow the height too. this is my code class SubjectCell: BaseCell { lazy var tableView:…
0
votes
1 answer

Setting the width for AdMob Native Ads in iOS UITableViewController

I've recently added Native Ads from AdMob in my iOS application. I've created a new cell and it has a view of type GADUnifiedNativeAdView. I've followed the instructions from Google and everything appears to be working great in the sense it fetches…
NullHypothesis
  • 4,286
  • 6
  • 37
  • 79
0
votes
1 answer

UITableViewCell expanding animation with self-sizing labels, visual animation problem

I've got a problem with self-sizing and animatable table view cells, with the animation part only. The issue is that when the cell expands, 2 of the labels are overlapped as the other items expand. If you look at the gif below, the top label "370…
0
votes
3 answers

how to fix tableview automatic height in swift?

I want to display vertical data collection view in table view cell. but when the data is first reloaded from json the height of the table view doesn't change automatically. but when the tableview is scrolled up, the height of the tableview changes…
0
votes
3 answers

Self sizing tableview inside self sizing tableview cell

Let's say I have hierarchy like this: *TableViewCell **TableView ***TableViewCell and all of them should be resizable. Did someone face this kind of problem? In past I've used many workarounds like systemLayoutSizeFitting or precalculation of…
えるまる
  • 2,409
  • 3
  • 24
  • 44
0
votes
2 answers

How to scroll to the bottom of a UITableView on the iPhone without seeing the scroll

I have a UITableView that is populated with cells of variable height. I would like the table to scroll to the bottom when the view is pushed into view. I currently have the following function: [self.table scrollToRowAtIndexPath:indexPath…
0
votes
1 answer

How to calculate right height of header in UITableView

I have a TableView. I added a header. Header contains dynamically data. So header height is calculating dynamically. But sometime height is correct, sometime header having too much extra space and sometime header is overlapping with tableview.…
0
votes
2 answers

UITableView inside UITableViewCell height issues

So basically, I want to embed a UITableView inside UITableViewCell. I used UIStackView to use its AutoLayout power! Anyway, each row of "Inner UITableView" will consist of a fixed sized UIImageView and a UILabel of lines = 0 (i.e. not…
Daksh Gargas
  • 3,498
  • 2
  • 23
  • 37
0
votes
2 answers

Is it possible to use self sizing cells within self sizing cells?

I want to have self sizing cells within a tableview with self sizing cells. But on first initialisation some cells are not correct. After a scroll to the bottom and the cells will display again the cell size is correct. In the screenshot you can see…
BasM
  • 25
  • 7
0
votes
2 answers

automatic height dimensions of the table view cell is not working properly

I am building the chat app in which I am using the automatic dimensions of table view for cells but height for cell is not working properly for some cells. and here is the constraints of view here is the screen shot of view hierarchy