uitableviewautomaticdimension

UITableViewAutomaticDimension not working on iOS 8

风格不统一 提交于 2019-12-22 05:36:10
问题 I was following this tutorial to make self sizing cells. I registered custom cell into table view and in the cell xib I gave every subview constraints manually. Please refer to the source code in GitHub Arranging 3 labels vertically in one cell's content view worked fine in iOS 9 but not in iOS 8 (both tested in device and simulator). In iOS 8 one cell does not have fitting height and not every label shows all it's full text. iOS 8 not fitting: iOS 9 as I expected: Any advice would be

Self sizing tableview inside self sizing tableview cell

≯℡__Kan透↙ 提交于 2019-12-18 09:47:17
问题 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 height in heightForRowAt , but it always breaks some constraints, because TableViewCell has height constraint equal to estimated row height and there appear some kinds of magic behavior. Any ways to make this live? Current workaround: class

Error: UITableView jump to top with UITableViewAutomaticDimension

让人想犯罪 __ 提交于 2019-12-17 15:56:22
问题 I am using UITableView with estimatedRowHeight and UITableViewAutomaticDimension . Also I am using NSFetchedResultsControllerDelegate to reflect the changes. Everything is work fine. Now the problem is when ever I add some record to CoreData , NSFetchedResultsController called the it's delegate but an unexpected things happen. TableView suddenly scroll to Top every time. NSFetchedResultsControllerDelegate func controllerWillChangeContent(controller: NSFetchedResultsController) { tableView

Detecting double and single tap on UITableViewCell to perform two action

一个人想着一个人 提交于 2019-12-12 09:39:24
问题 I have a PFQueryTableViewController in which I am trying to learn some tableView interactions. What I currently have: The tableView cell increases its height on a tap didSelectRowAtIndexPath or I can basically segue cell related data to next viewController using performSegueWithIdentifier together with prepareForSegue using a single tap. In the below code, if I comment the "Tap code to increases height of tableView cell" code, I can detect double tap. Other wise the single tap increases the

UITableViewAutomaticDimension Cells resize after scroll or pull to refresh

混江龙づ霸主 提交于 2019-12-12 04:17:46
问题 I have added a table view, and I am display image in the cells. I have also added this code: tableView.estimatedRowHeight = 175 tableView.rowHeight = UITableViewAutomaticDimension So that the cells resize depending on the image. When I launch my app though, I get this : And the images do not load untill I start scrolling...If I scroll down half the page then go back to the top, I get this(which is correct): Also if I remove the like button and just has the image alone in a cell, when I launch

How to change height Constraint of UIView in UitableviewCell when using UITableViewAutomaticDimension

和自甴很熟 提交于 2019-12-11 05:07:01
问题 I have a UIView in the UITableViewCell , which needs to change its height when user taps on "less/more" button My code is - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewAutomaticDimension; } 回答1: Hook items height constraint as IBOutlet and change it in cellForRow like this cell.viewHeightCon.constant = // value and before return cell add cell.layoutIfNeeded() 来源: https://stackoverflow.com/questions/48401654/how-to

UITableViewAutomaticDimension not working on iOS 8

五迷三道 提交于 2019-12-05 06:48:17
I was following this tutorial to make self sizing cells. I registered custom cell into table view and in the cell xib I gave every subview constraints manually. Please refer to the source code in GitHub Arranging 3 labels vertically in one cell's content view worked fine in iOS 9 but not in iOS 8 (both tested in device and simulator). In iOS 8 one cell does not have fitting height and not every label shows all it's full text. iOS 8 not fitting: iOS 9 as I expected: Any advice would be appreciated! Update code in viewDidLoad : tableView.registerNib(UINib.init(nibName: "SelfSizingCell", bundle:

Nib-file loaded UIView in UITableViewCell does not stretch

纵然是瞬间 提交于 2019-12-02 02:03:14
问题 I have a UIView which is reusable via a nib/xib-file. I want to load this and fill a UITableViewCell which is to be used in a self-resizing UITableView. All with auto-layout. Most works good, but It seems as the loaded UIView uses the added constraints around it to shrink the UITableViewCell's contentView. This is good for the height, but I don't want this for the width. Ignore the grey cell below, this is just a selected cell. public func tableView(_ tableView: UITableView, cellForRowAt

Self-Sizing TableView Cells based on two subview's height

僤鯓⒐⒋嵵緔 提交于 2019-11-30 09:55:49
问题 TableView Description tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 60.0 Cell Description I have a cell with 2 Labels(Title, Description) inside a ContainerView and 1 ImageView as below. Cell height will vary based on Description Label’s content. Contraints of all views There are two cases that I should handle ContainerView.height greater than (ImageView.height + ImageView.Top + ImageView.Bottom). Here cell's height will be based on ContainerView.height

Self-Sizing TableView Cells based on two subview's height

旧时模样 提交于 2019-11-29 17:28:14
TableView Description tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 60.0 Cell Description I have a cell with 2 Labels(Title, Description) inside a ContainerView and 1 ImageView as below. Cell height will vary based on Description Label’s content. Contraints of all views There are two cases that I should handle ContainerView.height greater than (ImageView.height + ImageView.Top + ImageView.Bottom). Here cell's height will be based on ContainerView.height ContainerView height less than (ImageView.height + ImageView.Top + ImageView.Bottom). Here I expect Cell