タブバーの項目を右から始めようとしています。私は次のように意味します:
オブジェクトのタブ:
1 2 3 4
次のようになります。
4 3 2 1
しかし、視覚的に行うと、次のようになります。
1 2 3 4
アイテムが視覚的に次のように見える場合:
4 3 2 1
1をオンにして開きたい(一番右のオプション)
どんな助けでも役に立ちます!ありがとう :)
タブバーの項目を右から始めようとしています。私は次のように意味します:
オブジェクトのタブ:
1 2 3 4
次のようになります。
4 3 2 1
しかし、視覚的に行うと、次のようになります。
1 2 3 4
アイテムが視覚的に次のように見える場合:
4 3 2 1
1をオンにして開きたい(一番右のオプション)
どんな助けでも役に立ちます!ありがとう :)
さて、あなたがしていることは、interfacebuilder の設定を無視することです。
あなたAppDelegate.m
は最も可能性の高いものを開始していますUITabbarController
...そしてそれを次のように変更します:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
UIViewController *viewController3 = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil];
UIViewController *viewController4 = [[FourthViewController alloc] initWithNibName:@"FourthViewController" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = @[viewController4, viewController3, viewController2, viewController1];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
これにより、タブが 4、3、2、1 の順序で表示されます。
xib ファイル内にある場合、またはコードでプログラムによって作成された場合は、タブ バー項目を並べ替えます。最初のタブを左側に設定するには、タブバー コントローラーで選択したアイテムをインデックス 0 に設定します。右側から開始する場合は、最後のタブバー アイテムにインデックスを設定します。