2012-04-20 58 views
0

我有一个巨大的问题,我已经集成的InMobi在我的应用程序,它支持犯规界面的方向,但是当我按下广告,查看被加载在上面,它转动,这不会是坏,但是当它旋转时,角度的扭曲,不覆盖全屏, 也许有人有过类似的问题? 我的代码:的InMobi方向iphone,

- (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]; 
} 

在此先感谢!

回答

4

看来你正在使用的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]; 
} 

希望这有助于!

+0

谢谢你,我已经联系技术支持团队,他们在那里非常有帮助,引导我在所需的步骤。你的回答是正确的:)谢谢! – Lukas 2012-04-23 12:07:41