1

これが私のコードです...

CGRect viewBounds = CGRectMake([[UIScreen mainScreen] applicationFrame].origin.x, 
[[UIScreen mainScreen] applicationFrame].origin.y, 
[[UIScreen mainScreen] applicationFrame].size.width, 
[[UIScreen mainScreen] applicationFrame].size.height-CGSizeFromGADAdSize(kGADAdSizeBanner).height);

 self.view.frame = viewBounds;

CGPoint origin = CGPointMake(0.0,theWebView.frame.size.height);

bannerView_ = [[[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner origin:origin] autorelease];


bannerView_.adUnitID = @"a151e39dc55f7f0";


bannerView_.rootViewController = self;

[self.view addSubview:bannerView_];

[self.view bringSubviewToFront:bannerView_];


GADRequest *request = [GADRequest request];

request.testDevices = [NSArray arrayWithObjects:
                       GAD_SIMULATOR_ID,                               // Simulator
                       @"heresthestringofmyphone",    // Test iPhone 3Gs 4.3.1
                       nil];

[bannerView_ loadRequest:request];
4

1 に答える 1

0

self.view.frame = viewBounds;

CGPoint 原点 = CGPointMake(0.0,theWebView.frame.size.height);

上記の 2 行を次のコードに置き換えると、魔法のように機能します。

[スーパー webView].frame=viewBounds;

CGPoint 原点 = CGPointMake(0.0,[スーパー webView].frame.size.height);

于 2013-08-21T12:00:03.000 に答える