2021-07-21

<UITableViewDelegate,UITableViewDataSource>
{
    //定义一个数据视图对象
    //数据视图用来显示大量相同格式的信息的视图
    //例如:电话通讯录,qq好友,朋友圈信息
    UITableView* _tableView;
    NSMutableArray* _arrayData;
}
#import "ViewControllerMy.h"
#import "ViewController.h"
#import "yunViewController.h"
@interface ViewControllerMy()
@end

@implementation ViewControllerMy
- (void)viewDidLoad {
    
    // Do any additional setup after loading the view.
    [super viewDidLoad];
 
    
    UIBarButtonItem *p1 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"yun.png"] style:UIBarButtonItemStylePlain target:self action:@selector(pressDown)];
    self.navigationItem.leftBarButtonItem = p1;
       // Do any additional setup after loading the view.
        UIImage* imageAccount = [UIImage imageNamed:@"账号.png"];
        UITabBarItem* tabBarItem = [[UITabBarItem alloc]initWithTitle:@"账号" image:imageAccount tag:101];
        self.tabBarItem = tabBarItem;

    
         //p1:位置 p2:风格
         _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 40, 375, 586)  style:UITableViewStyleGrouped];
            
            

    //设置数据视图的代理对象
    _tableView.delegate = self;
    //设置数据视图的数据源对象
    _tableView.dataSource = self;
     
         
         [self.view addSubview:_tableView];
    
    _arrayData = [[NSMutableArray alloc]init];
         
    NSArray* array01 = [NSArray arrayWithObjects:@"", nil];
    NSArray* array02 = [NSArray arrayWithObjects:@"我的音乐",@"", nil];
    NSArray* array03 = [NSArray arrayWithObjects:@"最近播放",@"", nil];
    NSArray* array04 = [NSArray arrayWithObjects:@"创建歌单⁴    收藏歌单⁹      歌单助手",@"", nil];
    
     [_arrayData addObject:array01];
     [_arrayData addObject:array02];
     [_arrayData addObject:array03];
     [_arrayData addObject:array04];
    
    UIButton* btnMy = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btnMy setImage:[[UIImage imageNamed:@"xiazai.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    btnMy.titleLabel.text = @"本地音乐";
    btnMy.titleLabel.font = [UIFont systemFontOfSize:10];
    btnMy.frame = CGRectMake(45, 145, 32, 32);
    [_tableView addSubview:btnMy];

    UILabel* label01 = [[UILabel alloc]init];
    label01.text = @"本地音乐";
    label01.frame = CGRectMake(35, 165, 80, 40);
    [_tableView addSubview:label01];
    label01.font = [UIFont systemFontOfSize:12];

    UIButton* btndt = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btndt setImage:[[UIImage imageNamed:@"电台.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    btndt.titleLabel.text = @"我的电台";
    btndt.titleLabel.font = [UIFont systemFontOfSize:10];
    btndt.frame = CGRectMake(130,145 , 32, 32);
    [_tableView addSubview:btndt];

    UILabel* label02 = [[UILabel alloc]init];
    label02.text = @"我的电台";
    label02.frame = CGRectMake(120, 165, 80, 40);
    [_tableView addSubview:label02];
    label02.font = [UIFont systemFontOfSize:12];

    UIButton* btnsc = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btnsc setImage:[[UIImage imageNamed:@"收藏.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    btnsc.titleLabel.text = @"我的收藏";
    btnsc.titleLabel.font = [UIFont systemFontOfSize:10];
    btnsc.frame = CGRectMake(215,145 , 30, 30);
    [_tableView addSubview:btnsc];
    
    UILabel* label03 = [[UILabel alloc]init];
    label03.text = @"我的收藏";
    label03.frame = CGRectMake(205, 165, 80, 40);
    [_tableView addSubview:label03];
    label03.font = [UIFont systemFontOfSize:12];
    
    UIButton* btnnew = [UIButton buttonWithType:UIButtonTypeRoundedRect];
      [btnnew setImage:[[UIImage imageNamed:@"新歌.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
      btnnew.titleLabel.text = @"关注新歌";
      btnnew.titleLabel.font = [UIFont systemFontOfSize:10];
      btnnew.frame = CGRectMake(295,145, 30, 30);
      [_tableView addSubview:btnnew];
      
      UILabel* label04 = [[UILabel alloc]init];
      label04.text = @"关注新歌";
      label04.frame = CGRectMake(285, 165, 80, 40);
      [_tableView addSubview:label04];
      label04.font = [UIFont systemFontOfSize:12];
    
    UIButton* btntouxiang = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btntouxiang setImage:[[UIImage imageNamed:@"001.jpg"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    btntouxiang.titleLabel.text = @"头像";
    btntouxiang.titleLabel.font = [UIFont systemFontOfSize:10];
    btntouxiang.frame = CGRectMake(10,20,90,90);
    [_tableView addSubview:btntouxiang];
    
    UILabel* label05 = [[UILabel alloc]init];
    label05.text = @"复杂化";
    label05.frame = CGRectMake(120, 40, 80, 40);
    [_tableView addSubview:label05];
    label05.font = [UIFont systemFontOfSize:18];
    _tableView.tableHeaderView = nil;
    _tableView.tableFooterView = nil;
       _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    UILabel* label06 = [[UILabel alloc]init];
    label06.text = @"LV.7";
    label06.frame = CGRectMake(122, 60, 80, 40);
    [_tableView addSubview:label06];
    label06.font = [UIFont systemFontOfSize:10];
    _tableView.tableHeaderView = nil;
    _tableView.tableFooterView = nil;
       _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
 //获取每组元素的个数(行数)
 //必须要实现的协议函数
 //程序在显示数据视图是会调用此函数
 //返回值:表示每组元素的个数
 //p1: 数据视图对象本身
 //p2:那一组需要的行数
-(void)pressDown{
    yunViewController* yun1 = [[yunViewController alloc]init];
    [self.navigationController pushViewController:yun1 animated:YES ];
//    NSLog(@"111");
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
     NSInteger numRow = [[_arrayData objectAtIndex:section]count];
    return numRow;
 }

 //设置数据视图的组数
 -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
//     return 5;
     return _arrayData.count;
 }
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//    NSString* cellStr = @"cell";
    //
//         UITableViewCell* cell01 = [_tableView dequeueReusableCellWithIdentifier:cellStr];
    UITableViewCell* cell = [_tableView dequeueReusableCellWithIdentifier:@"cell"];
        if(cell == nil){
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        }
    cell.textLabel.textColor = [UIColor blackColor];
        cell.textLabel.text = _arrayData[indexPath.section][indexPath.row];
    cell.accessoryType = UITableViewCellAccessoryNone;
        if(indexPath.section == 1 ){
            if(indexPath.row == 0){
                cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
            }else{
                    UIButton* btnMy1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
               [btnMy1 setImage:[[UIImage imageNamed:@"my1.jpg"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
               btnMy1.titleLabel.font = [UIFont systemFontOfSize:10];
               btnMy1.frame = CGRectMake(0, 250, 400, 180);
               [_tableView addSubview:btnMy1];
            }
    }
    if (indexPath.section == 2){
        if(indexPath.row == 0){
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        }else{
            UIButton* btnMy2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
            [btnMy2 setImage:[[UIImage imageNamed:@"my2.jpg"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
            btnMy2.titleLabel.font = [UIFont systemFontOfSize:10];
            btnMy2.frame = CGRectMake(0, 500, 400, 100);
            [_tableView addSubview:btnMy2];
        }
    }
    if (indexPath.section == 3){
         if(indexPath.row == 0){
             cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
         }else{
             UIButton* btnMy3 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
             [btnMy3 setImage:[[UIImage imageNamed:@"my3.jpg"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
             btnMy3.titleLabel.font = [UIFont systemFontOfSize:10];
             btnMy3.frame = CGRectMake(0, 650, 400, 180);
             [_tableView addSubview:btnMy3];
         }
       
    }
        return cell;

}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if(indexPath.section == 0  ){
        return 200;
    }
    if((indexPath.section == 1) && (indexPath.row == 1))
    return 200;
    if((indexPath.section == 2) && (indexPath.row == 1))
    return 110;
    if((indexPath.section == 3) && (indexPath.row == 1))
    return 220;
    return 45;
}
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    return [[UIView alloc]init];
}
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    return [[UIView alloc]init];
}
//- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
//{
//    switch (section) {
//        case 1:
//            return @"音乐服务";
//            break;
//        case 2:
//            return @"小工具";
//            break;
//        default:
//            return @"";
//            break;
//    }
//}
// -(NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
//     return @"音乐服务";
// }
 @end
@interface ViewControllerAccount : UIViewController
<UITableViewDelegate,UITableViewDataSource>
{
    //定义一个数据视图对象
    //数据视图用来显示大量相同格式的信息的视图
    //例如:电话通讯录,qq好友,朋友圈信息
    UITableView* _tableView;
    NSMutableArray* _arrayData;
    UISwitch* _Switch;
}
@end
#import "ViewControllerAccount.h"
#import "ViewController.h"
@interface ViewControllerAccount ()
@end

@implementation ViewControllerAccount
- (void)viewDidLoad {
    
    // Do any additional setup after loading the view.
    [super viewDidLoad];
 
       // Do any additional setup after loading the view.
        UIImage* imageAccount = [UIImage imageNamed:@"账号.png"];
        UITabBarItem* tabBarItem = [[UITabBarItem alloc]initWithTitle:@"账号" image:imageAccount tag:101];
        self.tabBarItem = tabBarItem;

    
         //p1:位置 p2:风格
         _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 40, 375, 586)  style:UITableViewStyleGrouped];
            
    _Switch = [[UISwitch alloc] init];
    _Switch.on = NO;

    //设置数据视图的代理对象
    _tableView.delegate = self;
    //设置数据视图的数据源对象
    _tableView.dataSource = self;
     
         
         [self.view addSubview:_tableView];
    
    _arrayData = [[NSMutableArray alloc]init];
         
    NSArray* array01 = [NSArray arrayWithObjects:@"", nil];
    NSArray* array02 = [NSArray arrayWithObjects:@"创作者中心", nil];
    NSArray* array03 = [NSArray arrayWithObjects:@"音乐服务",@"演出",@"商城",@"口袋铃声",@"在线听歌免流量", nil];
    NSArray* array04 = [NSArray arrayWithObjects:@"小工具",@"设置",@"夜间模式",@"定时关闭",@"音乐黑名单",@"鲸云音效",@"添加Siri捷径",@"音乐闹钟",@"青少年模式", nil];
    NSArray* array05 = [NSArray arrayWithObjects:@"我的订单",@"优惠卷",@"分享网易云音乐",@"关于", nil];
    NSArray* array06 = [NSArray arrayWithObjects:@"                                退出登陆", nil];
    
     [_arrayData addObject:array01];
     [_arrayData addObject:array02];
     [_arrayData addObject:array03];
     [_arrayData addObject:array04];
     [_arrayData addObject:array05];
     [_arrayData addObject:array06];
    
    UIButton* btnFriend = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btnFriend setImage:[[UIImage imageNamed:@"haoyou.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    btnFriend.titleLabel.text = @"我的好友";
    btnFriend.titleLabel.font = [UIFont systemFontOfSize:10];
    btnFriend.frame = CGRectMake(130, 145, 30, 30);
    [_tableView addSubview:btnFriend];

    UILabel* label01 = [[UILabel alloc]init];
    label01.text = @"我的好友";
    label01.frame = CGRectMake(125, 165, 80, 40);
    [_tableView addSubview:label01];
    label01.font = [UIFont systemFontOfSize:10];

    UIButton* btnNews = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btnNews setImage:[[UIImage imageNamed:@"xiaoxi.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    btnNews.titleLabel.text = @"我的消息";
    btnNews.titleLabel.font = [UIFont systemFontOfSize:10];
    btnNews.frame = CGRectMake(40,145 , 30, 30);
    [_tableView addSubview:btnNews];

    UILabel* label02 = [[UILabel alloc]init];
    label02.text = @"我的消息";
    label02.frame = CGRectMake(35, 165, 80, 40);
    [_tableView addSubview:label02];
    label02.font = [UIFont systemFontOfSize:10];

    UIButton* btnSelf = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btnSelf setImage:[[UIImage imageNamed:@"fangzi2.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    btnSelf.titleLabel.text = @"个性主页";
    btnSelf.titleLabel.font = [UIFont systemFontOfSize:10];
    btnSelf.frame = CGRectMake(215,145 , 30, 30);
    [_tableView addSubview:btnSelf];
    
    UILabel* label03 = [[UILabel alloc]init];
    label03.text = @"个性主页";
    label03.frame = CGRectMake(210, 165, 80, 40);
    [_tableView addSubview:label03];
    label03.font = [UIFont systemFontOfSize:10];
    
    UIButton* btnClo = [UIButton buttonWithType:UIButtonTypeRoundedRect];
      [btnClo setImage:[[UIImage imageNamed:@"yifu-2.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
      btnClo.titleLabel.text = @"个性装扮";
      btnClo.titleLabel.font = [UIFont systemFontOfSize:10];
      btnClo.frame = CGRectMake(295,145, 35, 35);
      [_tableView addSubview:btnClo];
      
      UILabel* label04 = [[UILabel alloc]init];
      label04.text = @"个性装扮";
      label04.frame = CGRectMake(290, 165, 80, 40);
      [_tableView addSubview:label04];
      label04.font = [UIFont systemFontOfSize:10];
    
    UIButton* btntouxiang = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btntouxiang setImage:[[UIImage imageNamed:@"001.jpg"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    btntouxiang.titleLabel.text = @"头像";
    btntouxiang.titleLabel.font = [UIFont systemFontOfSize:10];
    btntouxiang.frame = CGRectMake(10,20,90,90);
    [_tableView addSubview:btntouxiang];
    
    UILabel* label05 = [[UILabel alloc]init];
    label05.text = @"复杂化";
    label05.frame = CGRectMake(120, 40, 80, 40);
    [_tableView addSubview:label05];
    label05.font = [UIFont systemFontOfSize:18];
    _tableView.tableHeaderView = nil;
    _tableView.tableFooterView = nil;
       _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
 //获取每组元素的个数(行数)
 //必须要实现的协议函数
 //程序在显示数据视图是会调用此函数
 //返回值:表示每组元素的个数
 //p1: 数据视图对象本身
 //p2:那一组需要的行数
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
     NSInteger numRow = [[_arrayData objectAtIndex:section]count];
    return numRow;
 }

 //设置数据视图的组数
 -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
//     return 5;
     return _arrayData.count;
 }
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//    NSString* cellStr = @"cell";
    //
//         UITableViewCell* cell01 = [_tableView dequeueReusableCellWithIdentifier:cellStr];
    UITableViewCell* cell = [_tableView dequeueReusableCellWithIdentifier:@"cell"];
        if(cell == nil){
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        }
    cell.textLabel.textColor = [UIColor blackColor];
        cell.textLabel.text = _arrayData[indexPath.section][indexPath.row];
    cell.accessoryType = UITableViewCellAccessoryNone;
     UIImage* image1 = [UIImage imageNamed:@""];
                cell.imageView.image = image1;
        if(indexPath.section == 1 ){
             UIImage* image = [UIImage imageNamed:@"1.png"];
             cell.imageView.image = image;
         cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    if ((indexPath.section == 2)&&(indexPath.row != 0)) {
        NSString* str = [NSString stringWithFormat:@"%ld.png",indexPath.row % 5+ 1];
        UIImage* image2 = [UIImage imageNamed:str];
        cell.imageView.image = image2;
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
           
    }
    if ((indexPath.section == 3) && (indexPath.row != 0)){
        NSString* str1 = [NSString stringWithFormat:@"%ld.png",indexPath.row % 8+5];
              UIImage* image3 = [UIImage imageNamed:str1];
              cell.imageView.image = image3;
         cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        if(indexPath.row == 2){
//              UISwitch *Switch = [[UISwitch alloc] init];
            _Switch.frame = CGRectMake(290, 10, 80, 40);
//                      _Switch.on = YES;
                      [cell.contentView addSubview:_Switch];
        }
    }
    if (indexPath.section == 4){
        NSString* str2 = [NSString stringWithFormat:@"%ld.png",indexPath.row % 13+14];
              UIImage* image4 = [UIImage imageNamed:str2];
              cell.imageView.image = image4;
                    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    if(indexPath.section == 5){
        cell.textLabel.textColor = [UIColor redColor];
               }
        return cell;

}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if(indexPath.section == 0  ){
        return 200;
    }
    return 45;
}
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    return [[UIView alloc]init];
}
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    return [[UIView alloc]init];
}


#import <UIKit/UIKit.h>

@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>

@property (strong, nonatomic) UIWindow * window;

@end
#import "SceneDelegate.h"
#import "ViewControllerMy.h"
#import "ViewControllerWow.h"
#import "ViewControllerAccount.h"
#import "ViewControllerVideo.h"
#import "ViewControllerVillage.h"
#import "yunViewController.h"
//#import "ViewController.h"
@interface SceneDelegate ()

@end

@implementation SceneDelegate


- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
        1.创建一个导航控制器
//            UINavigationController *nav=[[UINavigationController alloc]init];
//        //    2.设置导航控制器为window的根视图
//            self.window.rootViewController =nav;

    ViewControllerMy* VCMy = [[ViewControllerMy alloc]init];
    ViewControllerWow* VCWow = [[ViewControllerWow alloc]init];
    ViewControllerVideo* VCVideo = [[ViewControllerVideo alloc]init];
    ViewControllerAccount* VCAccount = [[ViewControllerAccount alloc]init];
    ViewControllerVillage* VCVillage = [[ViewControllerVillage alloc]init];

    
    VCMy.title = @"我的";
    VCVillage.title = @"云村";
    VCVideo.title = @"视频";
    VCAccount.title = @"账号";
    VCWow.title = @"发现";

    VCMy.view.backgroundColor = [UIColor whiteColor];
    VCAccount.view.backgroundColor = [UIColor whiteColor];
    VCVideo.view.backgroundColor = [UIColor whiteColor];
    VCVillage.view.backgroundColor = [UIColor whiteColor];
    VCWow.view.backgroundColor = [UIColor whiteColor];

    
    UIBarButtonItem *p2 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"列表.png"] style:UIBarButtonItemStylePlain target:self action:nil];
    UIBarButtonItem *p3 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"saoyisao-2.png"] style:UIBarButtonItemStylePlain target:self action:nil];
//    VCVillage.navigationItem.leftBarButtonItem = p1;
    VCAccount.navigationItem.leftBarButtonItem = p3;
//    VCVideo.navigationItem.leftBarButtonItem = p1;
//    VCWow.navigationItem.leftBarButtonItem = p1;
    

    VCVillage.navigationItem.rightBarButtonItem = p2;
    VCAccount.navigationItem.rightBarButtonItem = p2;
    VCVideo.navigationItem.rightBarButtonItem = p2;
    VCWow.navigationItem.rightBarButtonItem = p2;
    VCMy.navigationItem.rightBarButtonItem = p2;

//
    //设置左上角的云为红色
        VCMy.navigationItem.leftBarButtonItem.tintColor = [UIColor redColor];
    VCAccount.navigationItem.leftBarButtonItem.tintColor = [UIColor grayColor];


            UINavigationController *a1 = [[UINavigationController alloc] initWithRootViewController:VCWow];

            UINavigationController *a2 = [[UINavigationController alloc] initWithRootViewController:VCVideo];

            UINavigationController *a3 = [[UINavigationController alloc] initWithRootViewController:VCMy];

            UINavigationController *a4 = [[UINavigationController alloc] initWithRootViewController:VCVillage];

            UINavigationController *a5 = [[UINavigationController alloc] initWithRootViewController:VCAccount];
//    创建一个控制器数组对象
//    将所有要被分栏控制器管理的对象添加到数组中
    NSArray* arrayVC = [NSArray arrayWithObjects:a1,a2,a3,a4,a5, nil];

    UITabBarController* tbController = [[UITabBarController alloc]init];

    tbController.viewControllers = arrayVC;

    tbController.selectedIndex = 2;
    //   将分栏控制器作为根视图
    self.window.rootViewController = tbController;
//
         [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 neccessarily 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
#import "yunViewController.h"
@interface yunViewController ()

@end

@implementation yunViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"btn02.jpg"]];
     self.title = @"网易云盘";
    UIBarButtonItem *leftBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"fanhui.png" ] style:UIBarButtonItemStylePlain target:self action:@selector(pressBack)];
    leftBtn.tintColor = [UIColor redColor];
    self.navigationItem.leftBarButtonItem = leftBtn;
}
-(void)pressBack{
    [self.navigationController popViewControllerAnimated:YES];
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值