简体   繁体   English

iOS在iPad详细信息拆分视图中更改iAD横幅大小

[英]iOS Change iAD banner size in iPad detail split view

I have a problem with the iAD banners in an iPad App that uses splitView. 我在使用splitView的iPad应用程序中使用iAD标语时遇到问题。 I would like to put the banner in the detail view in landscape mode, but the banner is cropped to the right side. 我想在横屏模式下将横幅广告置于局部视图中,但是将横幅广告裁剪到右侧。 Is there a way to resize it, maybe making it smaller to keep the aspect ratio? 有没有办法调整它的大小,或者使其更小以保持宽高比?

Tho show the banner I've used the standard code. 显示我已使用标准代码的横幅。

In the .h file 在.h文件中

#import <iAd/iAd.h>

and in the .m file: 并在.m文件中:

- (void)awakeFromNib
{
    [super awakeFromNib];
    self.canDisplayBannerAds = YES;
}

I'm adding a screenshot to show the situation: 我正在添加屏幕快照以显示这种情况: 在此处输入图片说明

I found another question here for this topic as I now have to deal with the same problem. 我在这里找到了关于该主题的另一个问题,因为我现在必须处理相同的问题。 Unfortunately that question is a little bit old: 不幸的是,这个问题有点老了:

how to add an adbannerview to a UISplitviewController 如何将adbannerview添加到UISplitviewController

As an example one could take one of the answers there with a link to iAdSuite where you have plenty of examples, how to programmatically solve this problem (back in 2011): 作为示例,您可以在其中找到一个答案,并链接到iAdSuite,其中有很多示例,介绍了如何以编程方式解决此问题(早在2011年):

iAdSuite iAdSuite

There is also a try there to make it with a storyboard, but it's not that up-to-date as I quickly see it. 也有尝试使用情节提要进行制作,但并不是我很快看到的最新内容。

Hope this helps and if you find a nice solution, please post it here! 希望这会有所帮助,如果您找到了一个不错的解决方案,请在此处发布! :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM