Closed nziebart closed 11 years ago
What do the logs show?
Also, unfortunately, your change breaks all implementations that I have, including the example project in the repo.
Hmm.. so this is interesting. If I put my view controller in a tab bar controller of a navigation controller and not just a bare view controller, the height/width is reported as "correct". When in a bare view controller, it is being reported as backwards when in landscape (like a window frame is reported). I changed the layout logic to look like this and it seems to be working:
CGFloat parentWidth = CGRectGetWidth(self.parentView.frame);
CGFloat parentHeight = CGRectGetHeight(self.parentView.frame);
if (UIInterfaceOrientationIsLandscape(orientation)) {
TOLLog(@"View is landscape");
if (pinningLocation == LARSAdControllerPinLocationBottom) {
yOrigin = MIN(parentHeight, parentWidth);
}
width = MAX(parentHeight, parentWidth);
self.lastOrientationWasPortrait = NO;
}
else{//portrait
TOLLog(@"View is portrait");
if (pinningLocation == LARSAdControllerPinLocationBottom) {
yOrigin = MAX(parentHeight, parentWidth);
}
width = MIN(parentHeight, parentWidth);
self.lastOrientationWasPortrait = YES;
}
I tried the change you posted and it works for me. I should have mentioned, I am using a UISplitViewController within a tab bar controller (the ads are added to the split view controller)
Ill go ahead and post this change. That's an interesting config that I haven't tried.
Hi,
I found that the AdContainerView frame is not getting set properly when added to a UIViewController that is within a UITabBarController. The ads display in portrait mode, but not landscape.
To fix this problem, I made a simple change to
containerFrameForInterfaceOrientation:withPinningLocation:
in LARSAdController.m: (I flipped the yOrigin and width assignments)