gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 17:38:15 24 4
gpt4 key购买 nike

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

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.

我已经实现了

- (UIDeviceOrientation)adWhirlCurrentOrientation
{
返回 UIDeviceOrientationLandscapeRight;

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

最佳答案

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

像这样:

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

关于iphone - 将 Adwhirl 广告方向从纵向更改为横向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9138796/

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