Pregunta

I have UITableViewController I want to add ADBannerView to its footer

so I added the framework iAd.framework , and tried the following code

- (void)viewDidLoad {

    [super viewDidLoad];

    ADBannerView* adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
    adView.frame = CGRectOffset(adView.frame, 0, -50);
    adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50];
    adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;

    [self.tableView.tableFooterView addSubview:adView];
}

But it doesn't appear.

am I missing something or what

Best regards

¿Fue útil?

Solución

That's not going to work. You'll have to implement the datasource method called tableView:viewForFooterInSection: and return the adbanner view. You might also have to implement the delegate method tableView:heightForFooterInSection:

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top