1

不得不以不同的方式解决它。还是要谢谢你的帮助!

4

3 回答 3

1

我通过将动态控件和表格放在单独的视图上解决了这样的问题。我有不同的导航栏高度 + iAd 横幅出现和消失。

- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
  if (!self.bannerIsVisible)
  {
    [UIView beginAnimations:@"animateAdBannerOn" context:NULL];
    banner.frame = CGRectMake(0, 0, 320, 50);

    self.tableView.frame = CGRectMake(0, 50, 320, self.view.frame.size.height - 50);

    [UIView commitAnimations];
    self.bannerIsVisible = YES;

  }
}

- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
    [UIView beginAnimations:@"animateAdBannerOn" context:NULL];
    banner.frame = CGRectMake(0, 0, 320, 0);

    self.tableView.frame = CGRectMake(0, 0, 320, self.view.frame.size.height);

    [UIView commitAnimations];
    self.bannerIsVisible = NO;
}
于 2013-05-13T12:30:27.503 回答
0

y如果你动态地将你的 UITableView 添加到 UIView,尝试设置 autoresizingMask:

tableView.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);

然后将 tableView 添加为 subView:

[view addSubView:tableView];

希望这可以帮助

于 2013-03-25T13:18:37.827 回答
0

您是否尝试在添加父 UIView 之前或之后为 UITableview 设置框架[myTableView setFrame:CGRectMake(parentView.frame.origin.x+5,parentView.frame.origin.y+5,parentView.frame.size.width-10,parentView.frame.size.height-10)];

于 2013-03-25T13:27:47.813 回答