支付宝

作者: 一只放生的小哈哈 | 来源:发表于2017-12-21 16:16 被阅读0次

AppDelegate里面的内容

#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 {
   
    // 创建控制器
    FirstViewController *fVC = [[FirstViewController alloc]init];
    // 创建导航控制器
    UINavigationController *fNav = [[UINavigationController alloc]initWithRootViewController:fVC];
    // 创建标签控制器
    UITabBarItem *item1 = [[UITabBarItem alloc]initWithTitle:@"首页" image:[UIImage imageNamed:@"DD"] selectedImage:[UIImage imageNamed:@"DD_H"]];
    // 把控制器赋给导航控制器
    fNav.tabBarItem = item1;
   
   
    // 创建控制器
    SecViewController *sVC = [[SecViewController alloc]init];
    // 创建导航控制器
    UINavigationController *sNav = [[UINavigationController alloc]initWithRootViewController:sVC];
    // 创建标签控制器
    UITabBarItem *item2 = [[UITabBarItem alloc]initWithTitle:@"口碑" image:[UIImage imageNamed:@"dongTai"] selectedImage:[UIImage imageNamed:@"dongTai_H"]];
    // 把控制器赋给导航控制器
    sNav.tabBarItem = item2;
    // 创建控制器
    ThreeViewController *tVC = [[ThreeViewController alloc]init];
    // 创建导航控制器
    UINavigationController *tNav = [[UINavigationController alloc]initWithRootViewController:tVC];
    // 创建标签控制器
    UITabBarItem *item3 = [[UITabBarItem alloc]initWithTitle:@"朋友" image:[UIImage imageNamed:@"DD"] selectedImage:[UIImage imageNamed:@"DD_H"]];
    // 把控制器赋给导航控制器
    tNav.tabBarItem = item3;
    // 创建控制器
    FourViewController *FVC = [[FourViewController alloc]init];
    // 创建导航控制器
    UINavigationController *FNav = [[UINavigationController alloc]initWithRootViewController:FVC];
    // 创建标签控制器
    UITabBarItem *item4 = [[UITabBarItem alloc]initWithTitle:@"我的" image:[UIImage imageNamed:@"dongTai"] selectedImage:[UIImage imageNamed:@"dongTai_H"]];
    // 把控制器赋给导航控制器
    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)];
        // 设置圆角属性
        _headImage.layer.cornerRadius = 20;
        _headImage.layer.masksToBounds = YES;
    }
    return _headImage;
}

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

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

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

// 第三个控制器里面的

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

UITableView *_tableView;

NSMutableDictionary *data;

}

@end

@implementation ThreeViewController

- (void)viewDidLoad {

[super viewDidLoad];

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

// 设置导航控制器的背景颜色

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

// 设置背景颜色

self.view.backgroundColor = [UIColor whiteColor];

// 初始化TableView

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

// 设置代理

_tableView.delegate = self;

_tableView.dataSource = self;

_tableView.rowHeight = 60;

// 将TableView添加到视图上

[self.view addSubview:_tableView];

}

// 设置行数

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

{

return 5;

}

// 数据源方法

- (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 = @"生活号";

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;

}

//第四个控制器里面的

@interface FourViewController (){

UITableView *_tableView;

NSArray *_imageArr;

NSArray *_titleArr;

}

@end

@implementation FourViewController

- (void)viewDidLoad {

[super viewDidLoad];

self.view.backgroundColor = [UIColor whiteColor];

// 设置导航控制器的背景颜色

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];

// 设置代理

_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 = @"未设置昵称";

[cell.contentView addSubview:titLabel];

}

if (indexPath.row == 1) {

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

cell.textLabel.text = @"蚂蚁会员";

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 = @"总资产";

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 = @"蚂蚁财富";

}

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 = @"保险服务";

}

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;

}

相关文章

  • 奖品合集

    支付宝44.44x12 支付宝200x1 支付宝121x1 支付宝111x1 支付宝100x1 支付宝88x1 支...

  • Android支付宝支付集成

    Android支付宝支付 标签: android Android支付宝支付使用的流程介绍 支付宝流程介绍 支付宝流...

  • 历害word哥,支付宝AR红包风靡朋友圈

    支付宝又来搞事情,2016年12月22日,支付宝又出新玩法:支付宝AR红包! 支付宝用户可以利用支付宝的红包功能:...

  • iOS支付宝功能集成

    iOS快速集成支付宝详解/支付宝集成获取私钥与公钥 在集成支付宝功能前,我们必须了解下什么支付宝流程,下图是支付宝...

  • 支付宝小程序相关文档

    支付宝开放平台文档 支付宝开放平台文档 支付宝开放平台文档 支付宝开放平台文档 获取手机号信息

  • 对接支付宝支付接口开发笔记

    支付宝对接学习笔记: 功能介绍: 支付宝对接 支付宝回调 查询支付状态(略过不讲) 要求: 熟悉支付宝对接核心文档...

  • 支付宝支付

    支付宝集成的介绍 第三方支付平台,支付宝是用户将钱付款给支付宝,之后支付宝将钱转入我们自己的账户。 集成支付宝的步...

  • ## [iOS 支付宝支付]

    [iOS开发系列-支付宝支付] 概述 开发中支付通常都会集成支付宝支付,下面讲解支付宝的整体流程。 集成支付宝支付...

  • 20180714早骑行20公里

    支付宝image.png支付宝的大楼还是很有特色的,类似古代的方形钱币。支付宝下面有很多银行。所以,支付宝和银行的...

  • UIWebView调起支付宝和微信客户端与回调的处理

    支付宝调起客户端 微信调起客户端 支付宝支付完成回调 根据支付宝官方给出回复,目前通过WebView调起支付宝客户...

网友评论

      本文标题:支付宝

      本文链接:https://www.haomeiwen.com/subject/ocpawxtx.html