I have UIScrollview with dynamic views(Label, Imageview) inside it. I hide some views but white blank space is there. how can I remove it?
I tried with below code but it doesn't work,
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:myView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0]];
The layout of File Like:
-View
-ScrollView
-UIImageView
-UIButton
-UIButton
-UILable
-UILable
-UIButton
-UILable
-UILable
UITableView
to achieve what you want? By doing so, you can "hide" views by using a datasource tied to the tableView, and then change the datasource, allowing the tableView to show only what is in the datasource. Afterall,UITableView
is a subclass ofUIScrollView
and gives you a lot of behavior for free to achieve what you want. – Tailback