larsacus / LARSAdController

Lightweight ad mediation for iOS to properly manage multiple ad networks dynamically including iAd and Google ads.
http://theonlylars.com/blog/2013/01/10/stupid-easy-ads-with-larsadcontroller-3-dot-0/
MIT License
269 stars 60 forks source link

Banner position in runtime #110

Closed paoloandrea closed 9 years ago

paoloandrea commented 9 years ago

How can i add the banner in a particular position in the interface in runtime. Have an example? Thank's to help me.

larsacus commented 9 years ago

What do you mean "in the runtime"? Do you mean at runtime?

There is a property on LARSAdController that should allow you to pin to the top or the bottom:

/** The location that the ad banner container will pin itself to.
 */
@property (nonatomic) LARSAdControllerPinLocation pinningLocation;
paoloandrea commented 9 years ago

Hi Iarsacus, thank you for respond me, but my question is different.

I need to put the banner in a custom position in my view controller. How can i manage the position x and y of the banner? Thank's for your great work.

larsacus commented 9 years ago

You have full access to the banner container that you can do whatever you want to with:

/** The container view that the ads are contained in. Exposed so you can do anything you would want with it.
 */
@property (nonatomic, readonly, strong) LARSAdContainer *containerView;
paoloandrea commented 9 years ago

Using containerView I still have the problem of positioning of the banner. What I want to do is just place it at 60px from the footer. Here's the code but does not respond properly. Can you help me fix it? Thank You.

define CONTROLLER_HEIGHT 60.0f

larsacus commented 9 years ago

Ok actually it looks like whatever you're doing is not going to work with how the internals are currently implemented. The library will still modify the frame based on the pinning position you have chosen, so setting a frame will likely get overridden when LARSAdController lays itself out.