我有一个很大的问题,我已经在我的应用程序中集成了inmobi,它不支持界面定向,但当我按下广告时,视图被加载到顶部,它会旋转,这不会很糟糕,但当它旋转时,视图会失真,不会覆盖整个屏幕,也许有人也有类似的问题?我的代码:
- (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];
}提前感谢!
发布于 2012-04-23 14:27:39
您使用的似乎是较旧版本的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];
}希望这能有所帮助!
https://stackoverflow.com/questions/10249151
复制相似问题