I have a Tableview with above it a Segmented Controller. Based on a previous user action, this segmented controller is either hidden or shown.
If it's hidden, I'd like to resize my tableview, so that it looks nice (else I have an empty gap on the screen).
I tried the following code (placed in the ViewDidLoad) but it did not work. It also didn't work when placed in the ViewDidAppear or other functions. The Tableview is referenced from the Storyboard, its not programmatically created.
if selectedGroup == 1
{
self.tableView.frame = CGRectMake(0, 152, 320, 367)
segControl.hidden = false
}
else if selectedGroup == 2
{
self.tableView.frame = CGRectMake(0, 116, 320, 403)
segControl.hidden = true
}
I tried some other stuff like working with offsetting the frame and then adjusting the height, but that didn't work either...