9.16. The use of the IOS tab bar

发布时间 :2025-10-25 12:23:56 UTC      

It is generally used to switch between subtasks, views, or models in the same view.

An example of the tab bar is as follows:

tabBar

Important attribute

  • BackgroundImage

  • Items

  • SelectedItem

Sample code and steps

1. 创建一个新的项目,选择 Tabbed Application 替代视图应用程序 ,点击下一步, 输入项目名称和选择 create .

  1. Here two view controllers and tab bars are created by default to add to our application.

  2. AppDelegate.m didFinishLaunchingWithOptions The methods are as follows:

- (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];
    self.tabBarController = [[UITabBarController alloc] init];
    self.tabBarController.viewControllers = @[viewController1,
    viewController2];
    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];
    return YES;
}
  1. Two view controllers are used to assign view controllers as tab bar controllers

  2. Run the application and get the following results:

tabBarOutput

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.