gpt4 book ai didi

iphone - Inmobi方向iphone,

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

我有一个大问题,我在我的应用程序中集成了 inmobi,它不支持界面方向,但是当我按下广告时, View 加载在顶部并旋转,这还不错,但是当它旋转, View 变得扭曲,不覆盖全屏,也许有人遇到过类似的问题?我的代码:

- (void)showInMobiBanner
{
if (_inMobView == nil)
{
_inMobView = [[IMAdView alloc] init];
_inMobView.delegate = self; //optional
_inMobView.imAppId = kInMobiAppId;
_inMobView.imAdUnit = IM_UNIT_320x50;
_inMobView.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
}
if (self.containerView != nil)
{
_inMobView.rootViewController = self.containerView;
}
else
{
_inMobView.rootViewController = self.navigationController;
}
IMAdRequest *request = [IMAdRequest request];
request.isLocationEnquiryAllowed = NO;

_inMobView.frame = CGRectMake(0, 0, 320, 50);
_inMobView.imAdRequest = request;
[_inMobView loadIMAdRequest:request];
[self.view addSubview:_inMobView];
}

提前致谢!

最佳答案

看来您使用的是旧版本的 InMobi SDK(3.0.2)。

最近推出了更新版本:http://developer.inmobi.com/wiki/index.php?title=IOS_SDK_350

引入了一种新方法:

- (BOOL)shouldRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation;

您可以在 UIViewController 中使用此方法,并像这样处理方向更改:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return [imAdView shouldRotateToInterfaceOrientation:interfaceOrientation];
}

希望这对您有所帮助!

关于iphone - Inmobi方向iphone,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10249151/

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