旗幟觀點只不過是一個普通視圖不同。所以你可以用其他視圖來做同樣的事情。以下是我在我的應用程序使用的代碼(我在屏幕底部的同一面旗幟視圖中,可以調整它的位置就擺在標籤欄上面):
- (void)viewDidLoad{
[super viewDidLoad];
//we don't want user to see the ads at the very first load.
//once, it succeeds, it will be animated up by the bannerViewDidLoadAd
adView = [[ADBannerView alloc] initWithFrame:CGRectMake(0, 480, 320, 50)];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
[adView setDelegate:self];
[self.view addSubview:adView];
self.bannerIsVisible = NO;
}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
if (!self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOn" context:NULL];
adView.frame = CGRectMake(0, 346, 320, 50);
[UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
if (self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
adView.frame = CGRectMake(0, 480, 320, 50);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
- (void)dealloc{
adView.delegate = nil;
[adView release];
[super dealloc];
}
任何可能創建一個子視圖在TTThumbviewConntroller和TTPhotoViewController中。 – Pugal 2010-08-17 17:57:24
感謝您的回覆。我的問題是,我有一個UIViewController中(如:galleryViewController)我想補充TTThumbviewcontroller的實例作爲一個子視圖我GalleryViewController。另外我想添加一個自定義的UIView(bView)到我的GalleryViewController。我可以通過[self.view addsubview:bView]添加我的自定義UIView。但我無法添加通過[self.view addsubview:TTTHumbInsace.view]安裝的TTThumbviewcontroller。 – Ram 2010-08-17 18:23:38
@Pugal,爲什麼不呢?它們只是標準視圖。 @Ram:那麼你是在問一個非常基本的問題,這個問題與Three20無關,而是一般的iPhone問題。查看視圖管理的一些文檔。你的第一個問題,這是不可能的,第2個:一個自定義的UIView是沒有任何問題您galleryviewcontroller添加,在上面的答案,AdView的是一個自定義的UIView你說,在頭宣佈它和你做。 – 2010-08-18 07:45:22