1
我有一個橫幅,需要在標籤欄控制器內的標籤欄下方顯示。讓它顯示並不是最難的部分,我已經解決了這個問題,但是看起來不知怎麼的,我正在使用的方法似乎把它放在了正常的輸入區域之外。在UITabBar下面獲取輸入
基本上,我使用這個橫幅作爲廣告,但我不希望它覆蓋標籤欄。
下面是我使用創建的標籤欄下方的橫幅代碼:
const float footerHeight = 34.5;
const float statusBarHeight = 20.f;
const float viewHeight = 480 - statusBarHeight - bannerHeight - footerHeight;
const float viewY = 0 + statusBarHeight + bannerHeight;
UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, viewHeight, 320, footerHeight)];
[footerView setContentMode:UIViewContentModeScaleToFill];
[footerView addSubview:footerButton];
[self.tabBarController.view addSubview:footerView];
[footerView release];
self.tabBarController.view.frame = CGRectMake(0, viewY, 320, viewHeight);
只是在一些變量的引用也有上面的視圖頂部的標題爲好。 footerButton
是我創建並連接IB的UIButton。