中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

網(wǎng)絡(luò)app制作網(wǎng)站有哪些內(nèi)容app開發(fā)流程

網(wǎng)絡(luò)app制作網(wǎng)站有哪些內(nèi)容,app開發(fā)流程,智能硬件開發(fā),有沒有什么做統(tǒng)計的網(wǎng)站一、導(dǎo)航控制器和工具欄 在 iOS 開發(fā)中,UINavigationController 是一個視圖控制器管理器,用于在多個視圖控制器之間進行有層級的導(dǎo)航(如頁面的前進、返回),就像網(wǎng)頁的前進/后退一樣。 繼承關(guān)系:NSObject-&…

一、導(dǎo)航控制器和工具欄

在 iOS 開發(fā)中,UINavigationController?是一個視圖控制器管理器,用于在多個視圖控制器之間進行有層級的導(dǎo)航(如頁面的前進、返回),就像網(wǎng)頁的前進/后退一樣。

繼承關(guān)系:NSObject->UIResponder->UIViewController->UINavigationController

#import <UIKit/UIKit.h>NS_ASSUME_NONNULL_BEGIN@interface VCRoot : UIViewController@endNS_ASSUME_NONNULL_END
#import "VCRoot.h"@interface VCRoot ()@end@implementation VCRoot- (void)viewDidLoad {[super viewDidLoad];[super viewDidLoad];self.view.backgroundColor = [UIColor blackColor];self.navigationItem.title = @"Pornhub";UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];[appearance configureWithOpaqueBackground];appearance.backgroundColor = [UIColor orangeColor];
appearance.titleTextAttributes = @{ NSForegroundColorAttributeName : [UIColor whiteColor] };self.navigationController.navigationBar.standardAppearance = appearance;self.navigationController.navigationBar.scrollEdgeAppearance = appearance;//創(chuàng)建一個導(dǎo)航欄左側(cè)的按鈕,這是根據(jù)title文字來創(chuàng)建的,傳入四個參數(shù)//第一個參數(shù)是按鈕上的文字內(nèi)容;第二個參數(shù)是按鈕風格//第三個參數(shù)是事件的擁有者;第四個參數(shù)是按鈕的事件函數(shù)UIBarButtonItem *leftBtn = [[UIBarButtonItem alloc] initWithTitle: @"<" style: UIBarButtonItemStyleDone target: self action: @selector(pressLeft)];//給導(dǎo)航欄的左側(cè)按鈕屬性賦值為我們創(chuàng)建好的左側(cè)按鈕self.navigationItem.leftBarButtonItem = leftBtn;//右側(cè)按鈕//和左側(cè)按鈕不同的是,這里創(chuàng)建右側(cè)按鈕的時候我們使用的初始化方法是不一樣的//這里的初始化方法不需要輸入文字內(nèi)容,而是指定了系統(tǒng)提供的風格樣式,系統(tǒng)風格的按鈕內(nèi)容或標題文字不可更改UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemAdd target: self action: @selector(pressRight)];self.navigationItem.rightBarButtonItem = rightBtn;//創(chuàng)建多按鈕://先創(chuàng)建一個標簽對象UILabel *label = [[UILabel alloc] initWithFrame: CGRectMake(10, 10, 50, 40)];label.text = @"???🔥🔞";//將label設(shè)置為居中l(wèi)abel.textAlignment = NSTextAlignmentCenter;label.textColor = [UIColor orangeColor];//將UIlabel類型的控件添加到導(dǎo)航欄按鈕//initWithCustomView就代表以自定義控件來初始化UIBarButtonItem *item3 = [[UIBarButtonItem alloc] initWithCustomView: label];//創(chuàng)建一個按鈕數(shù)組NSArray *arrayBtn = [NSArray arrayWithObjects: rightBtn, item3, nil];//將右側(cè)按鈕數(shù)組賦值self.navigationItem.rightBarButtonItems = arrayBtn;}- (void) pressLeft {NSLog(@"左側(cè)按鈕被按下");
}- (void) pressRight {NSLog(@"右側(cè)按鈕被按下");
}/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end
#import "SceneDelegate.h"
#import "VCRoot.h"
@interface SceneDelegate ()@end@implementation SceneDelegate- (void)scene:(UIScene *)scene
willConnectToSession:(UISceneSession *)sessionoptions:(UISceneConnectionOptions *)connectionOptions
{// 初始化 window 并綁定到當前 sceneself.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene];self.window.frame = [UIScreen mainScreen].bounds;// 創(chuàng)建根視圖控制器VCRoot* root = [[VCRoot alloc] init];// 創(chuàng)建導(dǎo)航控制器并設(shè)置根視圖控制器UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:root];// 設(shè)置 window 的根控制器self.window.rootViewController = nav;// 顯示窗口[self.window makeKeyAndVisible];
}- (void)sceneDidDisconnect:(UIScene *)scene {// Called as the scene is being released by the system.// This occurs shortly after the scene enters the background, or when its session is discarded.// Release any resources associated with this scene that can be re-created the next time the scene connects.// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}- (void)sceneDidBecomeActive:(UIScene *)scene {// Called when the scene has moved from an inactive state to an active state.// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}- (void)sceneWillResignActive:(UIScene *)scene {// Called when the scene will move from an active state to an inactive state.// This may occur due to temporary interruptions (ex. an incoming phone call).
}- (void)sceneWillEnterForeground:(UIScene *)scene {// Called as the scene transitions from the background to the foreground.// Use this method to undo the changes made on entering the background.
}- (void)sceneDidEnterBackground:(UIScene *)scene {// Called as the scene transitions from the foreground to the background.// Use this method to save data, release shared resources, and store enough scene-specific state information// to restore the scene back to its current state.
}@end

導(dǎo)航控制器切換

#import "VCRoot.h"
#import "VCSecond.h"
@interface VCRoot ()@end@implementation VCRoot- (void)viewDidLoad {[super viewDidLoad];[super viewDidLoad];self.view.backgroundColor = [UIColor blackColor];self.navigationItem.title = @"Pornhub";UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];[appearance configureWithOpaqueBackground];appearance.backgroundColor = [UIColor orangeColor];
appearance.titleTextAttributes = @{ NSForegroundColorAttributeName : [UIColor whiteColor] };self.navigationController.navigationBar.standardAppearance = appearance;self.navigationController.navigationBar.scrollEdgeAppearance = appearance;//創(chuàng)建一個導(dǎo)航欄左側(cè)的按鈕,這是根據(jù)title文字來創(chuàng)建的,傳入四個參數(shù)//第一個參數(shù)是按鈕上的文字內(nèi)容;第二個參數(shù)是按鈕風格//第三個參數(shù)是事件的擁有者;第四個參數(shù)是按鈕的事件函數(shù)UIBarButtonItem *leftBtn = [[UIBarButtonItem alloc] initWithTitle: @"<" style: UIBarButtonItemStyleDone target: self action: @selector(pressLeft)];//給導(dǎo)航欄的左側(cè)按鈕屬性賦值為我們創(chuàng)建好的左側(cè)按鈕self.navigationItem.leftBarButtonItem = leftBtn;//右側(cè)按鈕//和左側(cè)按鈕不同的是,這里創(chuàng)建右側(cè)按鈕的時候我們使用的初始化方法是不一樣的//這里的初始化方法不需要輸入文字內(nèi)容,而是指定了系統(tǒng)提供的風格樣式,系統(tǒng)風格的按鈕內(nèi)容或標題文字不可更改
//    UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemAdd target: self action: @selector(pressRight)];
//    self.navigationItem.rightBarButtonItem = rightBtn;UIBarButtonItem *next = [[UIBarButtonItem alloc] initWithTitle: @">>" style: UIBarButtonItemStylePlain target: self action: @selector(pressNext)];self.navigationItem.rightBarButtonItem = next;//創(chuàng)建多按鈕://先創(chuàng)建一個標簽對象UILabel *label = [[UILabel alloc] initWithFrame: CGRectMake(10, 10, 50, 40)];label.text = @"???🔥🔞";//將label設(shè)置為居中l(wèi)abel.textAlignment = NSTextAlignmentCenter;label.textColor = [UIColor orangeColor];//將UIlabel類型的控件添加到導(dǎo)航欄按鈕//initWithCustomView就代表以自定義控件來初始化UIBarButtonItem *item3 = [[UIBarButtonItem alloc] initWithCustomView: label];//創(chuàng)建一個按鈕數(shù)組// NSArray *arrayBtn = [NSArray arrayWithObjects: rightBtn, item3, nil];//將右側(cè)按鈕數(shù)組賦值
//    self.navigationItem.description = label;}- (void) pressLeft {NSLog(@"左側(cè)按鈕被按下");
}- (void)pressNext {//創(chuàng)建新的視圖控制器VCSecond *vcSecond = [[VCSecond alloc] init];//使用當前視圖控制器的導(dǎo)航控制器對象[self.navigationController pushViewController: vcSecond animated: YES];
}/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end
#import "VCSecond.h"
#import "VCThird.h"@interface VCSecond ()@end@implementation VCSecond- (void)viewDidLoad {[super viewDidLoad];//設(shè)置視圖二的標題和顏色self.view.backgroundColor = [UIColor whiteColor];self.title = @"歐美";//為視圖控制器導(dǎo)航欄設(shè)置右側(cè)按鈕UIBarButtonItem *btnNext = [[UIBarButtonItem alloc] initWithTitle: @"下一級" style: UIBarButtonItemStylePlain target: self action: @selector(pressNext)];self.navigationItem.rightBarButtonItem = btnNext;//為視圖控制器導(dǎo)航欄設(shè)置返回的左側(cè)按鈕UIBarButtonItem *btnLeft = [[UIBarButtonItem alloc] initWithTitle: @"返回上一級" style: UIBarButtonItemStylePlain target: self action: @selector(pressBack)];self.navigationItem.leftBarButtonItem = btnLeft;
}- (void)pressNext {//創(chuàng)建新的視圖控制器VCThird *vcThird = [[VCThird alloc] init];//推入第三個視圖控制器對象[self.navigationController pushViewController: vcThird animated: YES];}- (void)pressBack {//將當前視圖控制器彈出,返回到上一級界面[self.navigationController popViewControllerAnimated: YES];
}/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end
#import "VCThird.h"@interface VCThird ()@end@implementation VCThird- (void)viewDidLoad {[super viewDidLoad];self.view.backgroundColor = [UIColor colorWithRed: 0.7 green: 0.2 blue: 0.5 alpha: 1];self.title = @"亞非";UIBarButtonItem *btnLeft = [[UIBarButtonItem alloc] initWithTitle: @"返回上一級" style: UIBarButtonItemStylePlain target: self action: @selector(pressBack)];self.navigationItem.leftBarButtonItem = btnLeft;UIBarButtonItem *btnRight = [[UIBarButtonItem alloc] initWithTitle: @"返回根視圖" style: UIBarButtonItemStylePlain target: self action: @selector(pressRoot)];self.navigationItem.rightBarButtonItem = btnRight;
}- (void)pressBack {//將當前視圖控制器彈出,返回到上一級界面[self.navigationController popViewControllerAnimated: YES];
}- (void)pressRoot {//將當前視圖彈出,并返回根視圖[self.navigationController popToRootViewControllerAnimated: YES];
}/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end
#import "SceneDelegate.h"
#import "VCRoot.h"@interface SceneDelegate ()@end@implementation SceneDelegate- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {self.window.frame = [UIScreen mainScreen].bounds;//在這里創(chuàng)建了一個根視圖控制器,直接將這個根視圖控制器賦值給了導(dǎo)航控制器的根視圖對象,然后這個導(dǎo)航控制器又作為了window的根視圖控制器self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController: [[VCRoot alloc] init]];[self.window makeKeyAndVisible];
}- (void)sceneDidDisconnect:(UIScene *)scene {// Called as the scene is being released by the system.// This occurs shortly after the scene enters the background, or when its session is discarded.// Release any resources associated with this scene that can be re-created the next time the scene connects.// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}- (void)sceneDidBecomeActive:(UIScene *)scene {// Called when the scene has moved from an inactive state to an active state.// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}- (void)sceneWillResignActive:(UIScene *)scene {// Called when the scene will move from an active state to an inactive state.// This may occur due to temporary interruptions (ex. an incoming phone call).
}- (void)sceneWillEnterForeground:(UIScene *)scene {// Called as the scene transitions from the background to the foreground.// Use this method to undo the changes made on entering the background.
}- (void)sceneDidEnterBackground:(UIScene *)scene {// Called as the scene transitions from the foreground to the background.// Use this method to save data, release shared resources, and store enough scene-specific state information// to restore the scene back to its current state.
}@end

導(dǎo)航欄和工具欄

分欄控制器

? ?有以下幾個屬性:

UITabBarltem:分欄按鈕元素對象

badgeValue:分欄按鈕提示信息

selectedIndex:分欄控制器選中的控制索引

viewControllers:分欄控制器管理數(shù)組

selectedViewController:分欄控制器選中的控制器對象

? ? ? ? 要注意的是,在SceneDelegate中改了按鈕的標題內(nèi)容,然后又在創(chuàng)建的視圖控制器對象的.m文件中更改標題時,應(yīng)該在SceneDelegate中把會用到視圖控制器對象的.m中的viewDidLoad函數(shù)的語句放在在SceneDelegate的標題賦值語句的后面,因為如果不放在后面就會導(dǎo)致標題被覆蓋,無法更改為創(chuàng)建的視圖控制器對象的標題內(nèi)容

代碼演示:

首先需要創(chuàng)建三個視圖控制器:FirstVC、SecondVC、ThirdVC:

#import "FirstVC.h"@interface FirstVC ()@end@implementation FirstVC- (void)viewDidLoad {[super viewDidLoad];UITabBarItem* tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearchtag:101];self.tabBarItem = tabBarItem;// Do any additional setup after loading the view.
}/*
#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end
#import "SecondVC.h"@interface SecondVC ()@end@implementation SecondVC- (void)viewDidLoad {[super viewDidLoad];//根據(jù)系統(tǒng)風格設(shè)置分欄控制器按鈕,傳入兩個參數(shù)//第一個參數(shù)指分欄控制器的按鈕風格,第二個參數(shù)是分欄控件對象的標簽值UITabBarItem *tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemContacts tag: 103];//為分欄按鈕設(shè)置提示的標記值信息,是系統(tǒng)的,無法變更tabBarItem.badgeValue = @"99";self.tabBarItem = tabBarItem;}/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end
#import "ThirdVC.h"@interface ThirdVC ()@end@implementation ThirdVC- (void)viewDidLoad {[super viewDidLoad];UITabBarItem *tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavoritestag: 103];//為分欄按鈕設(shè)置提示的標記值信息,是系統(tǒng)的,無法變更tabBarItem.badgeValue = @"99";self.tabBarItem = tabBarItem;// Do any additional setup after loading the view.
}/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end
#import "SceneDelegate.h"
#import "FirstVC.h"
#import "SecondVC.h"
#import "ThirdVC.h"@interface SceneDelegate ()@end@implementation SceneDelegate- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {//創(chuàng)建三個視圖控制器并更改背景顏色和標題FirstVC *vc1 = [[FirstVC alloc] init];vc1.title = @"視圖1";SecondVC *vc2 = [[SecondVC alloc] init];vc2.title = @"視圖2";ThirdVC *vc3 = [[ThirdVC alloc] init];vc3.title = @"視圖3";vc1.view.backgroundColor = [UIColor brownColor];vc2.view.backgroundColor = [UIColor orangeColor];vc3.view.backgroundColor = [UIColor yellowColor];//創(chuàng)建分欄控制器對象UITabBarController *tbc = [[UITabBarController alloc] init];//創(chuàng)建一個控制器數(shù)組對象,并將所有要被分欄控制器管理的對象添加進數(shù)組//分欄控制器的按鈕的位置就取決于在數(shù)組中存放的位置NSArray *arrVC = [NSArray arrayWithObjects: vc1, vc2, vc3, nil];//將分欄控制器管理數(shù)組賦值tbc.viewControllers = arrVC;//將分欄控制器做為根視圖控制器self.window.rootViewController = tbc;//設(shè)置選中的視圖控制器的索引//通過索引來確定一打開程序的時候是顯示的哪一個視圖控制器,并且此時分欄控制器選中的控制器對象就是索引為2的視圖控制器tbc.selectedIndex = 2;//分欄控制器選中的控制器對象if (tbc.selectedViewController == vc3) {NSLog(@"分欄控制器選中的控制器對象是索引為2的視圖控制器");}//設(shè)置分欄控制器的工具欄的透明度tbc.tabBar.translucent = NO;//設(shè)置分欄控制器工具欄的背景顏色tbc.tabBar.backgroundColor = [UIColor whiteColor];//設(shè)置分欄控制器工具欄的按鈕選擇時顏色tbc.tabBar.tintColor = [UIColor redColor];}- (void)sceneDidDisconnect:(UIScene *)scene {// Called as the scene is being released by the system.// This occurs shortly after the scene enters the background, or when its session is discarded.// Release any resources associated with this scene that can be re-created the next time the scene connects.// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}- (void)sceneDidBecomeActive:(UIScene *)scene {// Called when the scene has moved from an inactive state to an active state.// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}- (void)sceneWillResignActive:(UIScene *)scene {// Called when the scene will move from an active state to an inactive state.// This may occur due to temporary interruptions (ex. an incoming phone call).
}- (void)sceneWillEnterForeground:(UIScene *)scene {// Called as the scene transitions from the background to the foreground.// Use this method to undo the changes made on entering the background.
}- (void)sceneDidEnterBackground:(UIScene *)scene {// Called as the scene transitions from the foreground to the background.// Use this method to save data, release shared resources, and store enough scene-specific state information// to restore the scene back to its current state.
}@end

分欄控制器高級

一些方法:

willBeginCustomizingViewControllers:即將顯示編輯方法

willEndCustomizingViewControllers:即將結(jié)束編輯方法

didEndCustomizingViewControllers:已經(jīng)結(jié)束編輯方法

didSelectViewController:選中控制器切換方法

在給分欄控件添加按鈕的時候,為了用戶體驗,下面頁面最多顯示五個按鈕,當添加的按鈕多于五個的時候,系統(tǒng)就會自動把最后一個按鈕替換成“more”,然后點開more,才能看見被折疊的其他按鈕。然后在點開more后的頁面中的右上角會有一個edit按鈕,這個按鈕點開后,會出現(xiàn)我們創(chuàng)建的全部視圖,拖動上面的任意視圖到下面的分欄視圖中,可以交換被折疊和被顯示的那兩個視圖

UITabBarControllerDelegate協(xié)議

為了實現(xiàn)UITabBarControllerDelegate協(xié)議,要在SceneDelegate.h中先引用該協(xié)議

代碼演示:

在此之前需要創(chuàng)建六個視圖控制器:FirstViewController、SecondViewController、ThirdViewController、ForthViewController、FifthViewController、sixthViewController

然后在在SceneDelegate.m中:

#import "SceneDelegate.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "ForthViewController.h"
#import "FifthViewController.h"
#import "SixthViewController.h"@interface SceneDelegate ()@end@implementation SceneDelegate- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {FirstViewController *vc1 = [[FirstViewController alloc] init];SecondViewController *vc2 = [[SecondViewController alloc] init];ThirdViewController *vc3 = [[ThirdViewController alloc] init];ForthViewController *vc4 = [[ForthViewController alloc] init];FifthViewController *vc5 = [[FifthViewController alloc] init];sixthViewController *vc6 = [[sixthViewController alloc] init];vc1.title = @"視圖1";vc2.title = @"視圖2";vc3.title = @"視圖3";vc4.title = @"視圖4";vc5.title = @"視圖5";vc6.title = @"視圖6";vc1.view.backgroundColor = [UIColor redColor];vc2.view.backgroundColor = [UIColor orangeColor];vc3.view.backgroundColor = [UIColor yellowColor];vc4.view.backgroundColor = [UIColor greenColor];vc5.view.backgroundColor = [UIColor blueColor];vc6.view.backgroundColor = [UIColor purpleColor];NSArray *arrVC = [NSArray arrayWithObjects: vc1, vc2, vc3, vc4, vc5, vc6, nil];UITabBarController *btc = [[UITabBarController alloc] init];btc.viewControllers = arrVC;self.window.rootViewController = btc;//處理UITabBarControllerDelegate協(xié)議函數(shù)//設(shè)置代理btc.delegate = self;
}//以下是協(xié)議中函數(shù)的用法,其中“編輯”是指在分欄控制器中的more中通過拖動更改和交換顯示和折疊的視圖控制器的操作------------------------------------------------------------
//即將開始編輯前會調(diào)用此協(xié)議函數(shù)
- (void)tabBarController:(UITabBarController *)tabBarController willBeginCustomizingViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers {NSLog(@"編輯前");
}//即將結(jié)束前調(diào)用該協(xié)議函數(shù)
- (void)tabBarController:(UITabBarController *)tabBarController willEndCustomizingViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers changed:(BOOL)changed {NSLog(@"即將結(jié)束前");
}//已經(jīng)結(jié)束編輯時調(diào)用該協(xié)議函數(shù)
- (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers changed:(BOOL)changed {if (changed == YES) {NSLog(@"順序發(fā)生改變");}NSLog(@"已經(jīng)結(jié)束編輯");
}//選中控制器對象時調(diào)用該協(xié)議函數(shù)
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
//    if (tabBarController.viewControllers[tabBarController.selectedIndex] == viewController) {
//        NSLog(@"選中的視圖索引與當前傳入的視圖索引相同");
//    }NSLog(@"選中控制器對象");
}- (void)sceneDidDisconnect:(UIScene *)scene {// Called as the scene is being released by the system.// This occurs shortly after the scene enters the background, or when its session is discarded.// Release any resources associated with this scene that can be re-created the next time the scene connects.// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}- (void)sceneDidBecomeActive:(UIScene *)scene {// Called when the scene has moved from an inactive state to an active state.// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}- (void)sceneWillResignActive:(UIScene *)scene {// Called when the scene will move from an active state to an inactive state.// This may occur due to temporary interruptions (ex. an incoming phone call).
}- (void)sceneWillEnterForeground:(UIScene *)scene {// Called as the scene transitions from the background to the foreground.// Use this method to undo the changes made on entering the background.
}- (void)sceneDidEnterBackground:(UIScene *)scene {// Called as the scene transitions from the foreground to the background.// Use this method to save data, release shared resources, and store enough scene-specific state information// to restore the scene back to its current state.
}@end

多界面?zhèn)髦?/h2>

在 iOS 開發(fā)中,多界面之間**傳值(數(shù)據(jù)傳遞)**是非常常見的場景,比如:

  • 登錄頁把用戶名傳到個人中心頁;

  • 設(shè)置頁把用戶修改的偏好設(shè)置返回給主界面;

  • 從商品列表點進詳情頁傳遞商品信息;

  • 在這里附上學長總結(jié)的博客:

iOS多界面?zhèn)髦礯ios navigationcontroller 隔層頁面?zhèn)髦?CSDN博客

UITableView

這部分是UI中的重中之重。

UITableView是iOS開發(fā)中的一個控件,用于展示列表數(shù)據(jù)。它類似于HTML中的表格,但更加強大和靈活。UITbleView可以支持滾動、選中、插入、刪除等操作,并且可以高度自定義。

(1)創(chuàng)建UITableView實例;
(2)設(shè)置UITableView的delegate和dataSource;
(3)實現(xiàn)UITableViewDelegate和UITableViewDataSource協(xié)議中的方法;
(4)將UITableView添加到視圖中。

http://www.risenshineclean.com/news/22118.html

相關(guān)文章:

  • 做女朋友的網(wǎng)站qq群引流推廣軟件
  • wordpress 一站多主題國內(nèi)優(yōu)秀網(wǎng)頁設(shè)計賞析
  • 與做機器人有關(guān)的網(wǎng)站軟件開發(fā)需要學什么
  • iis 網(wǎng)站目錄權(quán)限網(wǎng)站制作維護
  • 惠州seo推廣外包北京百度關(guān)鍵詞優(yōu)化
  • icp備案網(wǎng)站更名整站優(yōu)化多少錢
  • 做家具的企業(yè)網(wǎng)站最吸引人的營銷廣告詞
  • 免費游戲網(wǎng)頁入口西安網(wǎng)站seo外包
  • 深圳雙語網(wǎng)站制作網(wǎng)站的seo是什么意思
  • 怎么做裝修網(wǎng)站seo優(yōu)化招商
  • 家裝建材網(wǎng)購平臺推薦seo外鏈平臺
  • 做網(wǎng)站廠家廣告策劃公司
  • 做網(wǎng)站客戶沒有付定金深圳網(wǎng)站優(yōu)化推廣
  • 前端開發(fā)培訓機構(gòu)成都西安官網(wǎng)seo
  • 畢業(yè)設(shè)計做系統(tǒng)跟做網(wǎng)站哪個容易打廣告去哪個平臺免費
  • 香港做批發(fā)的網(wǎng)站有哪些手續(xù)合肥做網(wǎng)站哪家好
  • 音樂播放網(wǎng)站開發(fā)pc端設(shè)計師網(wǎng)站
  • 論壇門戶網(wǎng)站建設(shè)seo文章外包
  • 新網(wǎng)站快速提高排名cdq百度指數(shù)
  • 今天長沙做營銷推廣seo
  • app商城網(wǎng)站開發(fā)百度sem推廣具體做什么
  • 網(wǎng)站沒備案怎么做加速谷歌推廣外貿(mào)建站
  • 西安手機網(wǎng)站建設(shè)動力無限福州百度推廣優(yōu)化排名
  • 淄博網(wǎng)站建設(shè)服務(wù)商發(fā)帖子最好的幾個網(wǎng)站
  • 好文案網(wǎng)站seo范疇有哪些
  • 秦皇島網(wǎng)站設(shè)計seo引擎優(yōu)化怎么做
  • 重慶觀音橋旅游攻略寧波seo的公司聯(lián)系方式
  • 怎么優(yōu)化網(wǎng)站每日新聞
  • 網(wǎng)站開發(fā) 需求清單英文谷歌優(yōu)化
  • 秦皇島十大必去景點贛州seo顧問