mootymoots
mootymoots

Reputation: 4575

UISplitViewController - How to add a view over the top?

I want to add a view controller over the top of a UISplitViewController so that I can sit a horizontal iAd iPad banner across both views in the splitview.

Is this possible? It has to be a uiviewcontroller for the ADBannerView to be happy.

Upvotes: 2

Views: 1725

Answers (3)

Tim
Tim

Reputation: 1118

I think Apple have moved all their examples to here.

Also, I found this much simpler code in the AdBannerView Class Reference to deal with AdBanners that don't fit the view:

ADBannerView *myBannerView = <#Get a banner view#>;
UIView *myContainingView = <#Get the containing view#>;
NSSize newBannerSize = [myBannerView sizeThatFits:myContainingView];
[myBannerView setBounds:newBannerSize];

Upvotes: 0

Garoal
Garoal

Reputation: 2374

I know that this question is almost 2 years old, but I have found on apple examples the solution for this problem:

Here you can find the SplitViewBanner example that shows how to add a ADBannerView and a UISplitViewController to another view controller.

Upvotes: 1

donkim
donkim

Reputation: 13137

Yes, this should be possible. This isn't the cleanest way but I have added a view to the keyWindow, like this: [[[UIApplication sharedApplication] keyWindow] addSubview:someView];. This guarantees that it'll be the top-most view.

Another thing to consider is changing the frame of the UISplitViewController. Make it just tall enough to fit an ADBannerView underneath.

Upvotes: 0

Related Questions