I just dropped a view inside my table view, the view is containing images and labels. But Label content is dynamic and don’t wanna crop it instead I want to increase the height of the view as per need. But header view also doesn’t accept constraints. So would I achieve? The problem is occurring for the label which is placed above the find friends button.
Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
2
Answers
you need to estimate label height with text and plus with image/ button height to calculate total height of header view
here is the method to estimate header height:
or you can use auto layout to avoid estimate height:
TableView header height is not automatically refreshed and you must recalculate the height by your own each time its content changes. Heigh recalculation and tableview header refresh can be done in ‘viewDidLayoutSubviews’ method.
The answer and code snipet are brief summary of "Variable Height Table View Header" post, accessible at usyourloaf