0

I have a implemented a drop down menu above my UITableView and when I click on it I want my table view to go down inside the items of my drop down menu, because right now when I click on my drop down menu, the tableview stay where it is..

i have a view above my prototype cell that contain my drop down menu but I can't put any constraints on it... when I click in "filtre" I want this to happen : image description here

1 Answers1

0

it looks like you added a Table Header view. it is a little different than common UIView.

Instead of changing Height constraints, you'd better to change the frame of the headerview

how-to-set-the-height-of-table-header-in-uitableview

In addition, you can found good codes of dropdown implementation from these links. https://github.com/qmathe/DropDownMenuKit

https://github.com/onmyway133/Dropdowns

Li Jin
  • 1,879
  • 2
  • 16
  • 23
  • oh yeah I see thanks, but do you know what is the property I need to change to make this header view start lower or upper in the screen? – Sofiane Bensliman Jul 07 '19 at 11:17
  • let headerView = tableView.tableHeaderView! let height = headerView.systemLayoutSizeFitting(UILayoutFittingCompressedSize).height var frame = headerView.frame frame.size.height = height headerView.frame = frame tableView.tableHeaderView = headerView You can call this method on viewDidlayoutsubviews method. – Li Jin Jul 07 '19 at 11:28