ホームスクリー後に最初にスプラッシュ画面が表示されるようにプロジェクトを開発する必要があります。そのホーム画面には、下部にTabbarが含まれています。いずれかをお勧めします。どうやって進める。私はプログラム的に必要ですObjective cのホームページにタブバーを追加
-3
A
答えて
1
ストーリーボード代わりに使用することをお勧めします。
ViewController.hに:ViewController.mに
@property (nonatomic, retain) UITabBarController *tab;
を
self.tab = [UITabBarController new];
// FirstViewController
FirstViewController *vc1=[[FirstViewController alloc] initWithNibName:nil bundle:nil];
[email protected]"First View Controller";
vc1.tabBarItem.image = [UIImage imageNamed:@"viewcontroller1.png"];
//SecondViewController
SecondViewController *vc2 = [[SecondViewController alloc]initWithNibName:nil bundle:nil];
[email protected]"Second";
vc2.tabBarItem.image = [UIImage imageNamed:@"viewcontroller2.png"];
self.tab.viewControllers = @[vc1, vc2];
[self.view addSubview:self.tab.view];
1
これはいくつかのナビゲーションコントローラを備えたタブバーをプログラム的に作成する方法です。しかし、私は強くあなたが特定のビューコントローラにタブバーを作成したい場合は、だから、
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//Alloc all the VC of the tab bar
UIViewController *firstViewController = [[UIViewController alloc] init];
UIViewController *secondViewController = [[UIViewController alloc] init];
UIViewController *thirdViewController = [[UIViewController alloc] init];
//Create the tab bar
UITabBarController *tabBarController = [[UITabBarController alloc] init];
//Set the array of the tab bar with the VCs
tabBarController.viewControllers = @[firstViewController, secondViewController, thirdViewController];
//create the navigation controller
UINavigationController *navigationController = [[UINavigationControlle alloc] initWithRootViewController:tabBarController];
// init the app with the tab bar
self.window.rootViewController = tabBarController;
//
[self.window makeKeyAndVisible];
return YES;
}
関連する問題
- 1. タブバーの項目をクリックし、Objective-Cの
- 2. タブバーにアクティビティインジケータを追加
- 3. Objective-Cブリッジヘッダーエントリを追加するには?
- 4. Objective C SDKをXamarinに追加する
- 5. タブバーとタブバーの項目の間にサブビューを追加する
- 6. タブバーのコントローラクラッシュにviewControllerを追加する
- 7. Cocoa Objective-Cサブビューを追加する
- 8. uitableviewにタブバーを追加する方法
- 9. ホームページにアカウント作成ボックスを追加
- 10. Objective-Cの配列に変数を追加するには?
- 11. 特定のタブバーでアプリを開く方法は? iOS Objective-C
- 12. Objective-Cビューの最後にイメージのサムネイルを追加します。
- 13. Objective CのNSMutableArrayにオブジェクトを追加できません。
- 14. Objective-Cの配列に変数を追加する方法は?
- 15. Objective CのファイルにNSDataを追加します。
- 16. IOSのObjective-CアプリでGoogleマップにマーカー画像を追加
- 17. イメージにボタンのテキストを追加しますか? objective-c
- 18. Objective-cビューの下にサブビューを追加する
- 19. Objective-CでNSArrayの要素を追加するには?
- 20. 複数の動画をuicollectionviewに追加する - objective-c
- 21. 実行時にクラスにObjective-Cメソッドを追加する
- 22. ボタンをクリックしたときにテキストファイルを追加するObjective-C
- 23. Clangを使用してObjective-Cにキーワードを追加
- 24. Objective cでUITableViewにキャプチャイメージを追加する方法
- 25. Objective-C - 写真にGPS情報を追加する
- 26. Objective-C:カテゴリに属性を追加する
- 27. objective-c「ボタンを自動的に追加する」
- 28. box2Dオブジェクトにタグ(識別子)を追加する方法(objective-c)
- 29. NSMutableArrayにNSMutableArrayを追加する方法Objective-c
- 30. iPhoneプロジェクトにGoogle Objective-C API 'GTL'を追加する
私はUIViewControllerクラスをappdelegateクラスに書く必要はありません – vikramarkaios
特定のビューのcoコントローラ?あなたはより良いあなたの疑問を特定するべきです。 –
はい、私は特定のビューコントローラを実装する必要があります – vikramarkaios