I use a headerview
as a UITableView
subview, now I want to dynamic hide some view in the headerview
. My solution is send the headerview
to back of the UITableView
and update the contentoffset of the UITableView
.
Like this:(before)
The red rectangle is the headerview
and the green one is the hiddenview
.
(after)
But I can not touch button, textfield etc now. I have tried the hittest
and pointinside
methods, but it did not work. Maybe I use the wrong way. So anybody can help me? Thanks.
Hide subviews using headerview.subview.hidden = YES and updateConstraints if you are using auto layout otherwise update frame.