0

私は大きな問題を抱えています.インターフェイスの向きをサポートしていないアプリに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];
}

前もって感謝します!

4

1 に答える 1

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

お役に立てれば!

于 2012-04-23T06:27:39.170 に答える