0
我正在實施iAd到我的項目但問題出現時,我會將iAdd添加到我的播放列表頁面。然後顯示iAdd的演示版本,但是當我點擊該圖像時它不會打開整個page.Butwhen我會嘗試清空xib然後它會打開整個page.now我會告訴我的應用程序中使用的連接和代碼的整個過程。與我的項目實施iAd的問題
連接:addbanner連接到文件所有者&文件所有者連接到查看和addbanner。
我現在用滾動視圖playlistpage在我添加IAD它,並按照滾動按鈕
-(BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner
{
[self moveBannerViewOnscreen];
}
-(void)moveBannerViewOffscreen
{
//CGRect originalScrollFrame =self.scrollView.frame;
//CGFloat newScrollHeight =self.view.frame.size.height;
//CGRect newScrollFrame =originalScrollFrame;
//newScrollFrame.size.height =newScrollHeight;
CGRect newBannerFrame =self.bannerView.frame;
//newBannerFrame.origin.y =newBannerHeight;
//self.scrollView.frame =newScrollFrame;
self.bannerView.frame =newBannerFrame;
}
-(void)moveBannerViewOnscreen
{
CGRect newBannerFrame =self.bannerView.frame;
newBannerFrame.origin.y =self.view.frame.size.height -newBannerFrame.size.height;
//CGRect originalScrollFrame =self.view.frame.size.height - newBannerFrame.size.height;
//CGRect originalScrollFrame =self.scrollView.frame;
//CGRect newScrollHeight =newBannerFrame.size.height - self.view.frame.size.height;
//CGRect newScrollFrame =originalScrollFrame;
//newScrollFrame.size.height =newScrollHeight;
[UIView beginAnimations:@"BannerViewIntro" context :NULL];
self.bannerView.frame=newBannerFrame;
[UIView commitAnimations];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
[self movBannerViewOffscreen];
}
-(void)bannerViewDidLoadAd:(ADBannerView *)banner
{
[self moveBannerViewOnscreen];
}
-(BOOL)bannerViewActionDidFinish:(ADBannerView *)banner
{
//[Abtsk startAUGraph];
}
樣我都用的代碼alsoeven附上
b1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 15, 320, 85)];
[b1 setBackgroundImage:[UIImage imageNamed:@"1.jpg"] forState:UIControlStateNormal];
[b1 addTarget:self action:@selector(buttonPressed1:) forControlEvents: UIControlEventTouchUpInside];
[views addSubview:b1];
[b1 release];
請幫助我解決這個錯誤。
沒有任何這些回答你的問題?他們都是非常全面的答案,所以如果你不介意的話,我們很多人會感激你,如果你花時間選擇最有幫助的並接受它。 – SeniorShizzle 2010-07-05 09:05:42
當然,只需要移動/調整iAd出現的主視圖。例如,閱讀[iAd和ADBannerView代碼片段] [1]。 [1]:http://iphone-dev-tips.alterplay.com/2010/07/what-ive-already-used-more-than-once.html – slatvick 2010-07-18 05:42:12