0
votes

I am facing some problems related to autolayout, there are two custom views inside my Custom table cell, The both custom views which I am adding programmatically inside the UITableViewCell has to update the cell height dynamically.

The first view has a dynamic cell and its height is increasing with the custom View and having an effect on the cell height as well but the second view height have no effect on the cell height.

My First CustomView in nib This is my first custom view inside nib class

Constraints for my UILabel inside first custom View [Constraints added for UILabel inside first custom view[2]

Second customView [Second customView .[3]

This is my second view and the yellow view has the dynamic height based on the view size This is my second view and the yellow view has the dynamic height based on the view size

This is my custom Cell and have two views the top is first custom view and the second is second custom view which ill add from nib This is my custom Cell and have two views the top is first custom view and the second is second custom view which ill add from nib

Constriants of my first customView inside the cell Constriants of my first customView inside the cell

Constraints of my second customView inside cell Constraints of my second customView inside cell

The final result which is cutting the second view The final result which is cutting the second view

if ill gives the margin to my second view it will show the second view fine but cut the top view text.

        self.commentViewRef.bottomAnchor.constraint(equalTo: margins.bottomAnchor, constant: 0).isActive = true

Margin to second view cuts the first view text check below screenshotMargin to second view cuts the first view text

1

1 Answers

0
votes

If anyone wants to know about the solution, there was a small issue with my First customView in which the text label was attached with the bottom.