将 Adwhirl 广告方向从纵向更改为横向
我正在我的游戏中实施 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从未使用过它,但我想它们并不意味着您应该在 UIViewController 中实现 adWhirlCurrentOrientation 方法...
可能他们要求您调用 adwhirl 类中已有的方法,
你应该将其称为“在 UIViewController 的 should/willAutorotateToInterfaceOrientation 内:”,
如下所示:
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: