0
我有一个横向专用应用程序,我试图在iOS8上工作。我正在尝试创建横向视图底部显示的iAd横幅。但是,当显示广告标题时,它会在视图中心和纵向上显示。下面是我如何设置的意见:尽管窗口是横向的,但纵向方向的iAd横幅显示
app = (AppDelegate *)[[UIApplication sharedApplication] delegate];
// Init the Ad View Controller (viewController is defined as a UIViewController)
viewController = [[AdViewController alloc] initWithNibName:nil bundle:nil];
// Create a banner view controller and make the adViewController be the content controller for the bannerViewController
bannerViewController = [[BannerViewController alloc] initWithContentViewController:viewController];
[app.window addSubview:bannerViewController.view];
需要注意的是,如果我这个代码内测试statusBarOrientation,则说明该方向为横向。另外请注意,如果我改变的最后一行到bannerViewController.view添加到窗口的根视图,如下所示:
[app.nrViewController.view addSubview:bannerViewController.view];
结果是相同的。具体而言,广告横幅显示在视图的中心和纵向。横幅广告不应该以与其父广告相同的方向展示吗?
解决方案是什么? – ColdSteel 2015-04-18 23:05:25