2

I want to add an UIImageView on the top of the UITableView generated in the MoreNavigationController. To do this I need to change the UITableView's position and size.

Here is the code I tried:

UIImageView *img = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"barre.png"]];
    [img setFrame:CGRectMake(0, 20, 320, img.frame.size.height)];
    [self.tabBarController.moreNavigationController.view addSubview:img];
    [[[self.tabBarController.moreNavigationController.viewControllers objectAtIndex:0] view] setFrame:CGRectMake(0, 320, 320, 300)];

The image is added but the tableview size and position don't change. I also tried:

[self.tabBarController.moreNavigationController.topViewController.view setFrame:CGRectMake(0, 320, 320, 300)];
Sandy Chapman
  • 11,133
  • 3
  • 58
  • 67
Mehdi
  • 974
  • 1
  • 10
  • 24

0 Answers0