Monday 29 May 2017

Update constraints of other elements when UITableView height change? or Dynamic Height Issue for UITableView Cells (Swift)

https://stackoverflow.com/questions/34759302/update-constraints-of-other-elements-when-uitableview-height-change



 @IBOutlet weak var tableheight: NSLayoutConstraint!

 @IBOutlet weak var displayInvoicetableview: UITableView!

    

 override func viewDidLayoutSubviews()
    {
        tableheight.constant = self.displayInvoicetableview.contentSize.height
        self.view.layoutIfNeeded()
        

           }


-------------------------------------
after reload the table view it may not works then the solution for this in below link

https://stackoverflow.com/questions/32886811/when-is-it-most-appropriate-to-update-uitableview-height-nslayoutconstraint

No comments:

Post a Comment

Remove bottom line in navigation bar

navigationController ?. navigationBar . setBackgroundImage ( UIImage (), for: . any , barMetrics: . default )          navigat...