日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【UIKit】TabView

發(fā)布時間:2025/4/5 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【UIKit】TabView 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

?

【TabView】

?

?

【下面的tab欄】【?code】

【第一步】:創(chuàng)建一個Tabbed Application?

     

【第二步】:加入圖片素材。

【第三步】:創(chuàng)建3個有xib的類文件?FirstViewController,SecondViewController,ThirdViewController。

     

【第四步】:分別在FirstViewController,SecondViewController,ThirdViewController中加入下面的代碼

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; // 固定寫法if (self) {self.title = NSLocalizedString(@"關(guān)于我們", @"關(guān)于我們"); // 這個是加入標(biāo)題,顯示的標(biāo)題self.tabBarItem.image = [UIImage imageNamed:@"first"]; // 顯示自己圖片包中的對應(yīng)的圖片}return self; }

【第五步】:聲明窗口和代理方法

// 應(yīng)用程序委托 @interface AppDelegate : UIResponder <UIApplicationDelegate>// 窗口 @property (strong, nonatomic) UIWindow *window;// 根視圖控制器 @property (nonatomic,retain) UITabBarController *tabController;

【第六步】完善代碼

// 視圖加載完成,應(yīng)用程序加載到內(nèi)存后調(diào)用的方法 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {// 創(chuàng)建窗口self.window=[[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds] autorelease];// 創(chuàng)建3個視圖控制器FirstViewController *viewController1=[[FirstViewController alloc] initWithNibName:nil bundle:nil];SecondViewController *viewController2=[[SecondViewController alloc] initWithNibName:nil bundle:nil];ThirdViewController *viewController3=[[ThirdViewController alloc] initWithNibName:nil bundle:nil];// 把根視圖控制器作為窗口的 第一個視圖控制器self.tabController=[[UITabBarController alloc] init];self.tabController.viewControllers=@[viewController1,viewController2,viewController3];self.window.rootViewController=self.tabController;// 顯示窗口 [self.window makeKeyAndVisible];[viewController1 release];[viewController2 release];[viewController3 release];return YES; }

?

?


?

?

【創(chuàng)建有狀態(tài)欄的】【?Code】

【增加狀態(tài)欄】:增加前與增加后插入代碼【Code】

? ??

【第三方加入狀態(tài)標(biāo)欄】:引入第三方庫【Code】

其他詳見代碼。

?// 計算當(dāng)前高度

? ??CGFloat cellHeight = [tableView rectForRowAtIndexPath:indexPath].size.height;

?

轉(zhuǎn)載于:https://www.cnblogs.com/madeininfi/p/3676757.html

《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀

總結(jié)

以上是生活随笔為你收集整理的【UIKit】TabView的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。