1

Whenever the UIStackView is shown or hidden, the hiding and revealing parts are animated. Is it possible to remove animation on it altogether. Like it just appears and disappears. Thank you.

the current hierarchy looks like this ==> UITableView > table header UIView > UIStackView > UIView with header label UILabel. I'm trying to hide and show the table header.

code that I have tried so far...

  • headerView.frame.size.height = 0 - does not work since the contents of stack view is still shown
  • stackView.isHidden = true - still shows the blank header view which I want to be hidden
  • headerLabel.isHidden = true - same as above point, blank header view is still shown
as diu
  • 1,010
  • 15
  • 31
  • 1
    Can you update your post with some code which you did so far! – onCompletion Oct 11 '17 at 12:47
  • UIStackView shown or hidden or is it views in the stack view? – Au Ris Oct 11 '17 at 12:55
  • @AuRis - the current hierarchy looks like this ==> `UITableView` > table header `UIView` > `UIStackView` > `UIView` with header label `UILabel`. I'm trying to hide and show the table header itself. – as diu Oct 11 '17 at 13:20
  • @Tuhin post updated with three approaches I have tried so far. – as diu Oct 11 '17 at 13:24
  • If you want to hide table view header you do that by implementing table view's data source, in your case return `nil` in `viewForHeaderInSection`. – Au Ris Oct 11 '17 at 13:25
  • @AuRis I believe you are referring to section header. I'm referring to the tableViewHeaderFooter. The view added on top of prototype cells. – as diu Oct 11 '17 at 13:26
  • Then set your `tableView.tableHeaderView = nil` and reload your tableview by doing `tableView.reloadData()` – Au Ris Oct 11 '17 at 13:29
  • 2
    I think this is your answer [https://stackoverflow.com/questions/8079820/how-can-we-hide-the-tableheaderview-and-tablefooterview](https://stackoverflow.com/questions/8079820/how-can-we-hide-the-tableheaderview-and-tablefooterview) – Zee Oct 11 '17 at 15:09

0 Answers0