将 Adwhirl 广告方向从纵向更改为横向

发布于 2025-01-02 13:43:49 字数 592 浏览 1 评论 0原文

我正在我的游戏中实施 adwhirl 广告系统。我的游戏处于纵向模式,但我希望广告处于横向模式。 Adwhirl 开发人员文档说道:

6.2 设备方向 包括 iAd 在内的一些广告网络会根据设备方向改变其广告尺寸。 如果您的应用支持旋转,您必须通过在 UIViewController 的 should/willAutorotateToInterfaceOrientation: 实现中调用 AdWhirlView.rotateToOrientation: 将方向更改转发到 AdWhirlView,然后按照 6.1 进行重新调整。 如果您的应用的方向概念与 UIDevice.orientation 有所不同,您还必须实现 AdWhirlDelegate.adWhirlCurrentOrientation 以返回适当的值。

我已经实现了

- (UIDeviceOrientation)adWhirlCurrentOrientation { 返回UIDeviceOrientationLandscapeRight; }

方法,但广告仍然以纵向模式出现...知道我哪里出错了..或任何其他可能的方法吗?

I am implementing adwhirl ad system in my game . My game is in portrait mode but i want the ad to be in landscape mode . Adwhirl developer documentation says :

6.2 Device Orientation
Some ad networks including iAd will vary their ad dimensions with device orientation.
If your app supports rotation you must forward orientation changes to AdWhirlView by invoking AdWhirlView.rotateToOrientation: within your UIViewController’s should/willAutorotateToInterfaceOrientation: implementation and then refit as per 6.1.
If your app’s notion of orientation somehow differs from UIDevice.orientation you must also implement AdWhirlDelegate.adWhirlCurrentOrientation to return the appropriate value.

I had implementated

- (UIDeviceOrientation)adWhirlCurrentOrientation
{
return UIDeviceOrientationLandscapeRight;
}

method but ad still comes in portrait mode ...Any idea where m getting things wrong .. or any other posible way to do so ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葬花如无物 2025-01-09 13:43:49

我从未使用过它,但我想它们并不意味着您应该在 UIViewController 中实现 adWhirlCurrentOrientation 方法...
可能他们要求您调用 adwhirl 类中已有的方法,
你应该将其称为“在 UIViewController 的 should/willAutorotateToInterfaceOrientation 内:”,

如下所示:

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
    [yourAdwInstance rotateToOrientation:toInterfaceOrientation];
}

i've never used it, but i guess they don't mean you should implement the method adWhirlCurrentOrientation in you UIViewController...
probably the are asking you to CALL that method which is already in adwhirl class,
and you should call it "within your UIViewController’s should/willAutorotateToInterfaceOrientation:"

something like this:

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
    [yourAdwInstance rotateToOrientation:toInterfaceOrientation];
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文