Closed bsorrentino closed 10 years ago
As a general rule, you really should not be modifying view hierarchies which you do not directly control. Can you give me more description on what the exact issue is. Maybe post a screenshot?
Since i've updated the contentOffset to hide searchBar at startup of my UITableViewController (see code below), when the "iAD' banner shows up, its Y coordinate is wrong (should be less, see screenshot). For that reasons i added the code above that fix this problem
self.tableView.contentOffset = CGPointMake(0, self.searchBar.frame.size.height);
I think i see what the issue is in this case. It looks like your view controller is going to have to listen for when the banner is visible and update the view hierarchy to accommodate for this change. You can listen via KVO for changes in the banner visibility property on LARSAdController by subscribing to updates via the constant kLARSAdObserverKeyPathIsAdVisible
I have exposed. You can learn more about subscribing for KVO updates here. In your observer's callback, you will simply check to see if the banner is visible and adjust your table view accordingly. The ad controller should not modify the view hierarchy of the view that it is a child of.
Thanks for feedback. (I prefer a out-of-box solution)
I'll try and let you know
I've added "iAD" on UITableView where i had updated contentOffset. As consequence the banner was showed in wrong way because it doesn't take in consideration this case.
I've added the following code in
LARSAdController.m
methodcontainerFrameForInterfaceOrientation
and the problem has been fixedIs it possible to add this fix ?
Thanks in advance