:
m_yourToolbar =[[UIToolbar alloc] initWithFrame:CGRectMake(0, 401, 320, 44)];
// set some properties on the toolbar
// ...
[self.tabBarController.view m_yourToolbar];
이것은 UITabBarController가 모든 탭의 내용을 통해 UILabel의 ㅋ 추가 (m_tabBarController) . , 앱 위임의 보류를 얻을 수있는 도구 모음을 업데이트해야 뷰 컨트롤러에 따라서
@synthesize yourToolbar= m_yourToolbar;
// .. other app delegate stuff
yourToolbar 속성을 잡고 설정 : 앱 위임 구현에서
@interface YouAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
UIToolbar * m_yourToolbar;
// ... whatever other stuff you have in your app delegate
}
@property (nonatomic, retain) UIToolbar * yourToolbar;
당신이 필요합니다 속성 :
AppDelegate *appDelegate = (YouAppDelegate *)[[UIApplication sharedApplication] delegate];
// set stuff on the toolbar property
appDelegate.yourToolbar.stuff = stuff;
+1 이것은 특히 광고가 앱 전체에 나타나기를 원하는 경우 매우 일반적입니다. AdWhirl은이 정확한 것을 제안합니다. –
고마워, 나는 그것을 시험해 볼 것이다. 하지만 UITabBarController를 구현하는 가장 좋은 방법은 무엇입니까 (Xcode 템플릿에는이 .h & .m 파일이 없습니다 .tabBarController는 appDelegate에 선언되어 있습니다) –
UITabBarController를 구현할 필요가 없습니다. appDelegate에 선언 된 tabBarController에 액세스하면됩니다 (appDelegate 코드에서 m_tabBarController를 self.tabBarController로 바꿉니다). – RedBlueThing