KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to change the height of my tableview from another viewcontroller based on the sum of its cells' heights, as they are dynamic. Is it at all possible? Thanks Add-on: What I basically have is a UserProfileViewController that has a containerview on half of the screen. There I add different other viewcontrollers: In the case of the wall button this is how I add the viewcontroller and it's subsequent tableview: - (IBAction)wallButtonPressed:(id)sender { //Check if there is an instance of the viewcontroller we want to display. If not make one and set it's tableview frame to the container's view bounds if(!_userWallViewController) { self.userWallViewController = [[WallViewController alloc] init]; // self.userWallViewController.activityFeedTableView.frame = self.containerView.bounds; } [self.userWallViewController.containerView addSubview:self.userWallViewController.activityFeedTableView]; //If the currentviewcontroller adn it's view are already added to the hierarchy remove them [self.currentViewController.view removeFromSuperview]; [self.currentViewController removeFromParentViewController]; //Add the desired viewcontroller to the currentviewcontroller self.currentViewController = self.userWallViewController; //Pass the data needed for the desired viewcontroller to it's instances self.userWallViewController.searchURLString = [NSString stringWithFormat:@"event/user/%@/", self.userID]; self.userWallViewController.sendCommentURLString = [NSString stringWithFormat:@"event/message/%@", self.userID]; [self.userWallViewController.activityFeedTableView reloadData]; self.userWallViewController.totalCellHeight = ^(float totalCellHeight){ self.scrollView.contentSize = CGSizeMake
Tags (comma-separated)
Save Edits
Cancel