LARSAdController
LARSAdController copied to clipboard
Feature/shrinking content
Hi Lars
I was wondering if you could incorporate my pull and take a look at what could be a bug.
The pull involves the creation of new sample code, BannerViewAdDemo. This is based on the Apple sample code BannerView. Apple code allows the app to have a single iAd at the bottom and and the content is shrunk or grown depending on ad availability. This is like your moving button example but really useful for complex apps.
Now for the bug, run mine and rotate it to landscape. Notice the black bar? I had thought that this was because AdMob was serving up a 50 pixel ad that was really only 30 pixels high with 20 pixels of shadow. Now that I look at the portrait case, and your sample code, I'm not so sure.
I also modified your sample code so the bottom button would hug the bottom when rotated.
And thanks for an awesome set of code BTW, very helpful!
This pull got lost somewhere in my notifications and I'm just now looking at this.
But it simply looks like this pull request just adds another demo project and doesn't really change anything in the core files. You mention a bug, but there are no changes that really "fix" anything. Did I miss something?
On Oct 2, 2013, at 11:13 PM, Lars Anderson [email protected] wrote:
This pull got lost somewhere in my notifications and I'm just now looking at this.
No worries, I appreciate the all the work that you and all open source coders do!
But it simply looks like this pull request just adds another demo project and doesn't really change anything in the core files. You mention a bug, but there are no changes that really "fix" anything. Did I miss something?
Yes, the pull request is basically another piece of sample code that shows a quite different way to use LARSAdController. Your sample code places the ad on top of the view in the viewcontroller. My code, based on Apple's sample, shrinks the entire app and places the ad under it. This lets the UI adjust in size which is especially important if you have UI elements at the bottom of the screen.
In doing so I noticed a bug, not sure if it is in LARS or in AdMob, where the ad's frame height is NOT correct when rotated. This is ok when you just place the ad on TOP of the view since the the view just shows through the clear part. But when you slide up the bottom of the entire app, the gap is easily seen.
This is seen is both sample code projects.
On Oct 2, 2013, at 11:13 PM, Lars Anderson [email protected] wrote:
This pull got lost somewhere in my notifications and I'm just now looking at this.
But it simply looks like this pull request just adds another demo project and doesn't really change anything in the core files. You mention a bug, but there are no changes that really "fix" anything. Did I miss something?
OH, and I never got around to fixing it, I was working on this between clients and then got slammed!
I think I understand what's going on. You're assuming that the container view of LARSADController is always the exact height of the ad being displayed. This is not the case. The height of the container will vary, but will be at least as tall as it needs to be to contain the different ad types and does not change thought the life of the instance, which I imagine is why your are seeing the black bar (presumably the background) since the ad container's background is transparent.