UI_标签导航控制器

#import "AppDelegate.h"//#import "RootViewController.h"//#import "OneViewController.h"//#import "TwoViewController.h"#import "RootTabBarController.h"@interface AppDelegate ()@e
摘要由CSDN通过智能技术生成

#import "AppDelegate.h"

//#import "RootViewController.h"

//#import "OneViewController.h"

//#import "TwoViewController.h"

#import "RootTabBarController.h"


@interface AppDelegate ()


@end


@implementation AppDelegate



- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    /*

    RootViewController *rootVC = [[RootViewController alloc]init];

    UINavigationController *naVC = [[UINavigationController alloc]initWithRootViewController:rootVC];

    

    

    OneViewController *oneVC = [OneViewController new];

    UINavigationController *naVC1 = [[UINavigationController alloc]initWithRootViewController:oneVC];

    

    TwoViewController *twoVC = [TwoViewController new];

    UINavigationController *naVC2 = [[UINavigationController alloc]initWithRootViewController:twoVC];

  


//tabBarController的使用

        //初始化

    UITabBarController *myTabBarController = [UITabBarController new];

        //将创建好的导航控制器放入tabBarController

        //tabBarController添加子视图控制器

    myTabBarController.viewControllers = @[naVC,naVC1,naVC2];

        //设置底部的item

    naVC.tabBarItem.title = @"";

        //设置图片,去掉图片渲染

    naVC.tabBarItem.image = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

        //设置tabBarItem的颜色

    myTabBarController.tabBar.tintColor = [UIColor redColor];

        //设置tabBar的颜色

    myTabBarController.tabBar.barTintColor = [UIColor yellowColor];

        //设置item的角标

    naVC.tabBarItem.badgeValue = @"10";

        //设置默认被选中的item(切换界面就是依靠此属性的改变,默认值为0)

    myTabBarController.selectedIndex = 0;

    //myTabBarController.selectedViewController = naVC1;    等同上句

   

    

    //添加第二个

    naVC1.tabBarItem.title = @"";

    naVC1.tabBarItem.image = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    

    

    //添加第三个

    naVC2.tabBarItem.title = @"";

    naVC2.tabBarItem.image = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    

    

    

        //tabBarController设置为window的根视图控制器

    self.window.rootViewController = myTabBarController;

  */

 

    RootTabBarController *rootTabBarController = [RootTabBarController new];

    self.window.rootViewController = rootTabBarController;

    

    

    

    

    


    


    

    

    

    

    

    self.window.backgroundColor = [UIColor whiteColor];

    [self.window makeKeyAndVisible];

    return YES;

}@end




#import "RootTabBarController.h"

#import "RootViewController.h"

#import "OneViewController.h"

#import "TwoViewController.h"

#import "ThreeViewController.h"

#import "FourViewController.h"

#import "FiveViewController.h"

#import "SixViewController.h"

@interface RootTabBarController ()


@end


@implementation RootTabBarController


- (void)viewDidLoad {

    [super viewDidLoad];

//第一个

//    RootViewController *rootVC = [RootViewController new];

//    UINavigationController *navC = [[UINavigationController alloc]initWithRootViewController:rootVC];

//    

//    navC.tabBarItem.title = @"";

//    navC.tabBarItem.image = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

//    navC.tabBarItem.badgeValue = @"1";

//第一个

    OneViewController *oneVC = [OneViewController new];

    UINavigationController *one = [[UINavigationController alloc]initWithRootViewController:oneVC];

    

   // one.tabBarItem.title = @"";

   // one.tabBarItem.image = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    

        //系统的图标风格

    one.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:1001];

    one.tabBarItem.badgeValue = @"1";

//第二个

    TwoViewController *twoVC = [TwoViewController new];

    UINavigationController *two = [[UINavigationController alloc]initWithRootViewController:twoVC];

    

   // two.tabBarItem.title = @"";

   // two.tabBarItem.image = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    two.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:1002];

    two.tabBarItem.badgeValue = @"2";

    

    

//第三个

    ThreeViewController *threeVC = [ThreeViewController new];

    UINavigationController *three = [[UINavigationController alloc]initWithRootViewController:threeVC];

    

    //three.tabBarItem.title = @"";

    //three.tabBarItem.image = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    three.tabBarItem.badgeValue = @"3";

    

    UIImage *image1 = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    UIImage *image2 = [[UIImage imageNamed:@"Two30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    

    three.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"" image:image1 selectedImage:image2];

    

    

//第四个

    FourViewController *fourVC = [FourViewController new];

    UINavigationController *four = [[UINavigationController alloc]initWithRootViewController:fourVC];

    

    four.tabBarItem.title = @"";

    four.tabBarItem.image = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    four.tabBarItem.badgeValue = @"4";

//第五个

    FiveViewController *fiveVC = [FiveViewController new];

    UINavigationController *five = [[UINavigationController alloc]initWithRootViewController:fiveVC];

    

    //five.tabBarItem.title = @"";

    //five.tabBarItem.image = [[UIImage imageNamed:@"han30.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    five.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"" image:image1 tag:1005];

    five.tabBarItem.badgeValue = @"5";

    

 //第六个

    SixViewController *sixVC = [SixViewController new];

    UINavigationController *six = [[UINavigationController alloc]initWithRootViewController:sixVC];

    six.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"" image:image1 tag:1006];

    six.tabBarItem.badgeValue = @"6";

    

    

    

    

    

    

    

        //将标签加入到控制器中

    self.viewControllers = @[one,two,three,four,five,six];

        //设置标签字体颜色

    self.tabBar.tintColor = [UIColor redColor];

        //设置标签视图控制器的颜色

    self.tabBar.barTintColor = [UIColor yellowColor];

        //设置默认显示第几个

    self.selectedIndex = 2;

        //设置是否半透明

    self.tabBar.translucent = YES;

    

    

    

    

    

}










- (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

}


/*

#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 "RootViewController.h"


@interface RootViewController ()


@end


@implementation RootViewController


- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view.

}


- (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

}


/*

#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




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Element UI提供了很多成熟的组件和界面,其中管理界面是广泛应用于后台系统的一种界面。Element UI的管理界面源码是一份优秀的前端代码,一方面,其提供了较为完整的后台管理界面布局,包括了多级导航、面包屑导航、回到顶部、自适应布局等基本功能;另一方面,其源码设计简单清晰,易于维护和扩展,其核心思想是提供可复用的组件,通过组合这些组件,实现各种功能的布局和界面效果。最重要的是,Element UI的源码是基于Vue的,使用了Vue框架的特性,如组件化、响应式等,让用户在使用过程中更加方便,易于上手。 管理界面的源码分为两部分,一是布局组件,包括导航、头部、侧边栏等,其代码在Element UI中已经封装完成;二是具体功能页面组件,其代码需要用户根据实际需求进行编写。管理界面的核心是侧边栏,Element UI提供了灵活的侧边栏组件,可以通过传递参数调整展开和收起的位置,或者改变宽度,在侧边栏中嵌入了多个菜单组件,包括嵌套菜单、标签页、面包屑等,用户可以通过修改菜单配置,快速进行页面布局。管理界面中还包括了消息中心、活动预览、用户信息等组件,可以方便用户进行权限控制和信息展示。 总之,Element UI的管理界面源码值得学习和借鉴,其界面效果美观、稳定,源码实现简单清晰、易于上手,提供的组件丰富多样,在实际应用中具有良好的适应性,可以大大提高开发效率和代码质量。 ### 回答2: element ui的标准管理界面源码可以在它的Github仓库中找到。该管理界面由多个组件组成,每个组件都有对应的vue文件和scss文件。源码结构清晰,易于阅读和理解。 其中,主要的组件包括菜单栏、面包屑导航、搜索框、表格、表单等。这些组件都被封装成了通用的组件,方便开发者快速构建自己的管理界面。 除此之外,element ui的标准管理界面还包含了一些常用的插件,比如富文本编辑器、图表库等,大大提升了开发效率和用户体验。 总之,element ui的标准管理界面源码是一个优秀的前端开发资源,在实际开发中可以帮助开发者快速构建一款美观、易用、功能齐全的管理界面。同时,通过学习源码,还可以学习到很多前端开发的最佳实践和技巧。 ### 回答3: Element UI是一个非常流行的开源UI组件库,它提供了一系列美观易用的界面组件,并且是基于Vue.js构建的。其中就包括了标准管理界面,而其源码也是开源的,所有人都可以通过该库自由使用和二次开发。 标准管理界面是Element UI最常用的界面组件之一,它提供了一系列常用的管理界面模板和组件,如数据表格、表单、分页、筛选器等等。用户可以通过简单的配置,即可快速构建一套完整的管理界面应用。 Element UI的标准管理界面源码非常易懂,所有代码都采用了易于理解的模块化组织方式。开发者可以通过这些代码,更好地理解Vue.js组件的设计和开发方式。在其中最关键的部分,即数据的处理和渲染方面,Element UI采用了非常精简的技术方案,保证了应用的高效性和稳定性。 总之,Element UI的标准管理界面源码是一份非常优秀的开源代码,它的设计和实现都非常精良,可作为Vue.js组件开发者的一个优秀参考。如果你正在开发Vue.js应用,那么不妨通过学习这些源码来更好地理解Vue.js的组件设计思路和技术实现方案。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值