ホームスクリー後に最初にスプラッシュ画面が表示されるようにプロジェクトを開発する必要があります。そのホーム画面には、下部に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. タブバーにアクティビティインジケータを追加
- 4. Objective C SDKをXamarinに追加する
- 5. Objective-Cブリッジヘッダーエントリを追加するには?
- 6. テーブルビューコントローラーストーリーボードのタブバーを追加
- 7. タブバーとタブバーの項目の間にサブビューを追加する
- 8. タブバーのコントローラクラッシュにviewControllerを追加する
- 9. Cocoa Objective-Cサブビューを追加する
- 10. ホームページをblog.phpに変更して別のホームページを追加
- 11. uitableviewにタブバーを追加する方法
- 12. TabControllerにプログラムでタブバーを追加
- 13. UIVisualEffectViewをタブバーにも追加する
- 14. 特定のタブバーでアプリを開く方法は? iOS Objective-C
- 15. Objective-Cの配列に変数を追加するには?
- 16. ホームページにアカウント作成ボックスを追加
- 17. Objective-Cビューの最後にイメージのサムネイルを追加します。
- 18. Objective-CでNSArrayの要素を追加するには?
- 19. イメージにボタンのテキストを追加しますか? objective-c
- 20. Objective CのファイルにNSDataを追加します。
- 21. Objective-cビューの下にサブビューを追加する
- 22. IOSのObjective-CアプリでGoogleマップにマーカー画像を追加
- 23. Xamarin:オブザーバブルコレクションにオブジェクトを追加する際のObjective-C例外
- 24. Objective-Cの配列に変数を追加する方法は?
- 25. 複数の動画をuicollectionviewに追加する - objective-c
- 26. Objective CのNSMutableArrayにオブジェクトを追加できません。
- 27. TabLayoutでスワイプを追加する(タブバー)
- 28. 実行時にクラスにObjective-Cメソッドを追加する
- 29. Clangを使用してObjective-Cにキーワードを追加
- 30. ボタンをクリックしたときにテキストファイルを追加するObjective-C
私はUIViewControllerクラスをappdelegateクラスに書く必要はありません – vikramarkaios
特定のビューのcoコントローラ?あなたはより良いあなたの疑問を特定するべきです。 –
はい、私は特定のビューコントローラを実装する必要があります – vikramarkaios