支付寶

AppDelegate里面的內(nèi)容

#import "AppDelegate.h"
#import "FirstViewController.h"
#import "SecViewController.h"
#import "ThreeViewController.h"
#import "FourViewController.h"
@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
???
??? // 創(chuàng)建控制器
??? FirstViewController *fVC = [[FirstViewController alloc]init];
??? // 創(chuàng)建導(dǎo)航控制器
??? UINavigationController *fNav = [[UINavigationController alloc]initWithRootViewController:fVC];
??? // 創(chuàng)建標(biāo)簽控制器
??? UITabBarItem *item1 = [[UITabBarItem alloc]initWithTitle:@"首頁" image:[UIImage imageNamed:@"DD"] selectedImage:[UIImage imageNamed:@"DD_H"]];
??? // 把控制器賦給導(dǎo)航控制器
??? fNav.tabBarItem = item1;
???
???
??? // 創(chuàng)建控制器
??? SecViewController *sVC = [[SecViewController alloc]init];
??? // 創(chuàng)建導(dǎo)航控制器
??? UINavigationController *sNav = [[UINavigationController alloc]initWithRootViewController:sVC];
??? // 創(chuàng)建標(biāo)簽控制器
??? UITabBarItem *item2 = [[UITabBarItem alloc]initWithTitle:@"口碑" image:[UIImage imageNamed:@"dongTai"] selectedImage:[UIImage imageNamed:@"dongTai_H"]];
??? // 把控制器賦給導(dǎo)航控制器
??? sNav.tabBarItem = item2;
??? // 創(chuàng)建控制器
??? ThreeViewController *tVC = [[ThreeViewController alloc]init];
??? // 創(chuàng)建導(dǎo)航控制器
??? UINavigationController *tNav = [[UINavigationController alloc]initWithRootViewController:tVC];
??? // 創(chuàng)建標(biāo)簽控制器
??? UITabBarItem *item3 = [[UITabBarItem alloc]initWithTitle:@"朋友" image:[UIImage imageNamed:@"DD"] selectedImage:[UIImage imageNamed:@"DD_H"]];
??? // 把控制器賦給導(dǎo)航控制器
??? tNav.tabBarItem = item3;
??? // 創(chuàng)建控制器
??? FourViewController *FVC = [[FourViewController alloc]init];
??? // 創(chuàng)建導(dǎo)航控制器
??? UINavigationController *FNav = [[UINavigationController alloc]initWithRootViewController:FVC];
??? // 創(chuàng)建標(biāo)簽控制器
??? UITabBarItem *item4 = [[UITabBarItem alloc]initWithTitle:@"我的" image:[UIImage imageNamed:@"dongTai"] selectedImage:[UIImage imageNamed:@"dongTai_H"]];
??? // 把控制器賦給導(dǎo)航控制器
??? FNav.tabBarItem = item4;
???
??? UITabBarController *tabBar = [[UITabBarController alloc]init];
???
??? tabBar.viewControllers = @[fNav,sNav,tNav,FNav];
???
??? self.window.rootViewController = tabBar;

??? return YES;
}

// 自定義cell

.H文件里面的

@property (nonatomic,strong)UIImageView *headImage;
@property (nonatomic,strong)UILabel *titLabel;
@property (nonatomic,strong)UILabel *subLabel;

@property (nonatomic,strong)UILabel *timeLabel;

.M文件里面的

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
??? if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
??????? [self.contentView addSubview:self.headImage];
??????? [self.contentView addSubview:self.titLabel];
??????? [self.contentView addSubview:self.subLabel];
??????? [self.contentView addSubview:self.timeLabel];
??? }
??? return self;
}


-(UIImageView *)headImage
{
??? if (!_headImage) {
??????? // 初始化
??????? _headImage = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 40, 40)];
??????? // 設(shè)置圓角屬性
??????? _headImage.layer.cornerRadius = 20;
??????? _headImage.layer.masksToBounds = YES;
??? }
??? return _headImage;
}

- (UILabel *)titLabel
{
??? if (!_titLabel) {
??????? // 初始化label
??????? _titLabel = [[UILabel alloc]initWithFrame:CGRectMake(60, 5, 100, 30)];
??????? // 設(shè)置Label的字體
??????? _titLabel.font = [UIFont systemFontOfSize:16];
???????
??? }
??? return _titLabel;
}

- (UILabel *)subLabel
{
??? if (!_subLabel) {
??????? // 初始化label
??????? _subLabel = [[UILabel alloc]initWithFrame:CGRectMake(60, 30, 350, 20)];
??????? // 設(shè)置label的字體
??????? _subLabel.font = [UIFont systemFontOfSize:12];
??? }
??? return _subLabel;
}

- (UILabel *)timeLabel
{
??? if (!_timeLabel) {
??????? // 初始化Label
??????? _timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(350, 10, 40, 40)];
??????? // 設(shè)置字體
??????? _timeLabel.font = [UIFont systemFontOfSize:12];
??? }
??? return _timeLabel;
}


// 第三個(gè)控制器里面的

#import "ThreeViewController.h"#import "FriendTableViewCell.h"@interface ThreeViewController (){

UITableView *_tableView;

NSMutableDictionary *data;

}

@end

@implementation ThreeViewController

- (void)viewDidLoad {

[super viewDidLoad];

self.navigationItem.title = @"朋友";

// 設(shè)置導(dǎo)航控制器的背景顏色

self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:25/255.0 green:108/255.0 blue:198/255.0 alpha:1.0];

// 設(shè)置背景顏色

self.view.backgroundColor = [UIColor whiteColor];

// 初始化TableView

_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 70, self.view.frame.size.width, 300) style:UITableViewStylePlain];

// 設(shè)置代理

_tableView.delegate = self;

_tableView.dataSource = self;

_tableView.rowHeight = 60;

// 將TableView添加到視圖上

[self.view addSubview:_tableView];

}

// 設(shè)置行數(shù)

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

return 5;

}

// 數(shù)據(jù)源方法

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

FriendTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];

if (!cell)

{

cell = [[FriendTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];

}

if (indexPath.row == 0)

{

cell.headImage.image = [UIImage imageNamed:@"1.jpg"];

cell.titLabel.text = @"生活號(hào)";

cell.subLabel.text = @"哈哈哈哈哈哈";

cell.timeLabel.text = @"昨天";

}

if (indexPath.row == 1)

{

cell.headImage.image = [UIImage imageNamed:@"2.jpg"];

cell.titLabel.text = @"張森";

cell.subLabel.text = @"吃雞大神";

cell.timeLabel.text = @"昨天";

}

if (indexPath.row == 2)

{

cell.headImage.image = [UIImage imageNamed:@"3.jpg"];

cell.titLabel.text = @"張昆";

cell.subLabel.text = @"吃雞菜雞";

cell.timeLabel.text = @"昨天";

}

if (indexPath.row == 3)

{

cell.headImage.image = [UIImage imageNamed:@"4.jpg"];

cell.titLabel.text = @"大狗";

cell.subLabel.text = @"傻狗一只";

cell.timeLabel.text = @"昨天";

}

if (indexPath.row == 4)

{

cell.headImage.image = [UIImage imageNamed:@"5.jpg"];

cell.titLabel.text = @"小狗";

cell.subLabel.text = @"哈哈哈哈哈哈";

cell.timeLabel.text = @"昨天";

}

return cell;

}


//第四個(gè)控制器里面的

@interface FourViewController (){

UITableView *_tableView;

NSArray *_imageArr;

NSArray *_titleArr;

}

@end

@implementation FourViewController

- (void)viewDidLoad {

[super viewDidLoad];

self.view.backgroundColor = [UIColor whiteColor];

// 設(shè)置導(dǎo)航控制器的背景顏色

self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:25/255.0 green:108/255.0 blue:198/255.0 alpha:1.0];

self.navigationItem.title = @"我的";

_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 60, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStyleGrouped];

// 設(shè)置代理

_tableView.delegate = self;

_tableView.dataSource = self;

[self.view addSubview:_tableView];

_imageArr = @[@"1.jpg",@"2.jpg"];

}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

{

return 3;

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

if (section == 0)

{

return 2;

}

else if (section == 1)

{

return 6;

}

return 4;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];

if (!cell)

{

cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];

}

if (indexPath.section == 0)

{

if (indexPath.row == 0)

{

cell.backgroundColor = [UIColor colorWithRed:25/255.0 green:108/255.0 blue:198/255.0 alpha:1.0];

cell.imageView.image = [UIImage imageNamed:@"1.jpg"];

UILabel *titName = [[UILabel alloc]initWithFrame:CGRectMake(80, 25, 90, 30)];

titName.text = @"白玉霜";

[cell.contentView addSubview:titName];

UILabel *subName = [[UILabel alloc]initWithFrame:CGRectMake(80, 50, 230, 30)];

subName.text = @"www.baidu.com";

subName.font = [UIFont systemFontOfSize:12];

[cell.contentView addSubview:subName];

UILabel *titLabel = [[UILabel alloc]initWithFrame:CGRectMake(140, 30, 90, 20)];

titLabel.font = [UIFont systemFontOfSize:13];

titLabel.text = @"未設(shè)置昵稱";

[cell.contentView addSubview:titLabel];

}

if (indexPath.row == 1) {

cell.imageView.image = [UIImage imageNamed:@"2.jpg"];

cell.textLabel.text = @"螞蟻會(huì)員";

cell.detailTextLabel.text = @"你有積分即將到期";

cell.detailTextLabel.font = [UIFont systemFontOfSize:13];

}

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

return cell;

}

if (indexPath.section == 1) {

if (indexPath.row == 0) {

cell.imageView.image =? [UIImage imageNamed:@"3.jpg"];

cell.textLabel.text = @"賬單";

}

if (indexPath.row == 1) {

cell.imageView.image =? [UIImage imageNamed:@"4.jpg"];

cell.textLabel.text = @"總資產(chǎn)";

cell.detailTextLabel.text = @"賬戶安全保障中";

cell.detailTextLabel.textColor = [UIColor colorWithRed:107/255.0 green:175/255.0 blue:156/255.0 alpha:1.0];

cell.detailTextLabel.font = [UIFont systemFontOfSize:13];

}

if (indexPath.row == 2) {

cell.imageView.image =? [UIImage imageNamed:@"1.jpg"];

cell.textLabel.text = @"余額";

cell.detailTextLabel.text = @"0.00元";

//? ? ? ? ? ? cell.detailTextLabel.textColor = [UIColor colorWithRed:107/255.0 green:175/255.0 blue:156/255.0 alpha:1.0];

//? ? ? ? ? ? cell.detailTextLabel.font = [UIFont systemFontOfSize:13];

}

if (indexPath.row == 3) {

cell.imageView.image =? [UIImage imageNamed:@"2.jpg"];

cell.textLabel.text = @"余額寶";

}

if (indexPath.row == 4) {

cell.imageView.image =? [UIImage imageNamed:@"3.jpg"];

cell.textLabel.text = @"余利寶";

}

if (indexPath.row == 5) {

cell.imageView.image =? [UIImage imageNamed:@"4.jpg"];

cell.textLabel.text = @"銀行卡";

}

}

if (indexPath.section == 2) {

if (indexPath.row == 0) {

cell.imageView.image =? [UIImage imageNamed:@"1.jpg"];

cell.textLabel.text = @"螞蟻財(cái)富";

}

if (indexPath.row == 1) {

cell.imageView.image =? [UIImage imageNamed:@"2.jpg"];

cell.textLabel.text = @"芝麻信用";

}

if (indexPath.row == 2) {

cell.imageView.image =? [UIImage imageNamed:@"3.jpg"];

cell.textLabel.text = @"保險(xiǎn)服務(wù)";

}

if (indexPath.row == 3) {

cell.imageView.image =? [UIImage imageNamed:@"4.jpg"];

cell.textLabel.text = @"花唄";

}

}

//? ? cell.imageView.image =? [UIImage imageNamed:@"1.jpg"];

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

return cell;

}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

{

if (indexPath.section == 0) {

if (indexPath.row == 0)

{

return 100;

}

}

return 50;

}

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末谐岁,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子榛臼,更是在濱河造成了極大的恐慌伊佃,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,755評(píng)論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件沛善,死亡現(xiàn)場離奇詭異航揉,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)金刁,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,305評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門帅涂,熙熙樓的掌柜王于貴愁眉苦臉地迎上來议薪,“玉大人,你說我怎么就攤上這事媳友∷挂椋” “怎么了?”我有些...
    開封第一講書人閱讀 165,138評(píng)論 0 355
  • 文/不壞的土叔 我叫張陵醇锚,是天一觀的道長哼御。 經(jīng)常有香客問我,道長焊唬,這世上最難降的妖魔是什么艇搀? 我笑而不...
    開封第一講書人閱讀 58,791評(píng)論 1 295
  • 正文 為了忘掉前任,我火速辦了婚禮求晶,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘衷笋。我一直安慰自己芳杏,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,794評(píng)論 6 392
  • 文/花漫 我一把揭開白布辟宗。 她就那樣靜靜地躺著爵赵,像睡著了一般。 火紅的嫁衣襯著肌膚如雪泊脐。 梳的紋絲不亂的頭發(fā)上空幻,一...
    開封第一講書人閱讀 51,631評(píng)論 1 305
  • 那天,我揣著相機(jī)與錄音容客,去河邊找鬼秕铛。 笑死,一個(gè)胖子當(dāng)著我的面吹牛缩挑,可吹牛的內(nèi)容都是我干的但两。 我是一名探鬼主播,決...
    沈念sama閱讀 40,362評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼供置,長吁一口氣:“原來是場噩夢啊……” “哼谨湘!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起芥丧,我...
    開封第一講書人閱讀 39,264評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤紧阔,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后续担,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體擅耽,經(jīng)...
    沈念sama閱讀 45,724評(píng)論 1 315
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,900評(píng)論 3 336
  • 正文 我和宋清朗相戀三年赤拒,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了秫筏。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片诱鞠。...
    茶點(diǎn)故事閱讀 40,040評(píng)論 1 350
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖这敬,靈堂內(nèi)的尸體忽然破棺而出航夺,到底是詐尸還是另有隱情,我是刑警寧澤崔涂,帶...
    沈念sama閱讀 35,742評(píng)論 5 346
  • 正文 年R本政府宣布阳掐,位于F島的核電站,受9級(jí)特大地震影響冷蚂,放射性物質(zhì)發(fā)生泄漏缭保。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,364評(píng)論 3 330
  • 文/蒙蒙 一蝙茶、第九天 我趴在偏房一處隱蔽的房頂上張望艺骂。 院中可真熱鬧,春花似錦隆夯、人聲如沸钳恕。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,944評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽忧额。三九已至,卻和暖如春愧口,著一層夾襖步出監(jiān)牢的瞬間睦番,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,060評(píng)論 1 270
  • 我被黑心中介騙來泰國打工耍属, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留托嚣,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,247評(píng)論 3 371
  • 正文 我出身青樓恬涧,卻偏偏與公主長得像注益,于是被迫代替她去往敵國和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子溯捆,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,979評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容