0

ベスト プラクティスとは何か、および画面下部に広告バナーを表示する方法を知りたいです。phonegap 2.5 を使用していますが、画面の上部に表示できます。これは、adBannerView を作成する方法です。

- (void)webViewDidFinishLoad:(UIWebView*)theWebView
{
    // Black base color for background matches the native apps
    theWebView.backgroundColor = [UIColor blackColor];

    adView = [[[ADBannerView alloc] initWithFrame:CGRectZero] autorelease];
    //adView.frame = CGRectMake(0, 410, 320, 50); // if you want the banner to be on top of the screen remove this line
    adView.delegate = self;
    adView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
    [theWebView addSubview:adView];

    return [super webViewDidFinishLoad:theWebView];
}

iphone (4,5) の解像度が異なるため、上記のコメントアウトされたラインアップに基づいて位置を修正するかどうかはわかりません。画面下に配置する方法を教えてください。

ありがとう。

このリンクにあるものを試しましたが、競合する制約に関するエラーが発生します

4

1 に答える 1

1

これを試して !

adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
CGRect adFrame = adView.frame;
adFrame.origin.y = self.view.frame.size.height-adView.frame.size.height;
adView.frame = adFrame;
[theWebView addSubview:adView];
于 2013-04-01T18:53:33.353 に答える