gpt4 book ai didi

iphone - 减少 ABBannerView 大小以获得宽度 = 300 而不是 320

转载 作者:行者123 更新时间:2023-11-29 04:45:22 25 4
gpt4 key购买 nike

我在屏幕上显示 BannerView 时遇到问题,如下图所示: enter image description here

即使我设置了bannerFrame.size.width = 300; ,但没有得到。

所以我需要将bannerView的大小减小10+10= 20像素,以避免bannerView在我的背景 ImageView 上重叠。

请帮帮我。

最佳答案

Documentation说:

A banner view must always use one of the standard sizes defined in “Content Size Identifiers.” This is to ensure that the advertisement is drawn correctly. You configure the banner view’s requiredContentSizeIdentifiers property with the set of possible sizes your view is allowed to use in your application. To change the size of the banner view, do not set the bounds directly; instead set the currentContentSizeIdentifier property to one of the size identifiers included in that set. You can retrieve the actual dimensions that a particular identifier equates to on a specific device by calling the sizeFromBannerContentSizeIdentifier: class method.

更新

请引用这个document for BannerView

创建 ADBannerView 并为其指定大小:

ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];

adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;

[self.view addSubview:adView];

关于iphone - 减少 ABBannerView 大小以获得宽度 = 300 而不是 320,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9733668/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com