美文网首页
IOS - 分段控制器SegmentedControl

IOS - 分段控制器SegmentedControl

作者: 繁重 | 来源:发表于2019-01-04 20:59 被阅读0次

    首先导入#import "CNavTabBarController.h"文件

    
    #import "NewsController.h"
    #import "Sca1ViewController.h"
    #import "Sca2ViewController.h"
    #import "Sca3ViewController.h"
    #import "Sca4ViewController.h"
    
    #import "SCNavTabBarController.h"
    
    @interface NewsController (){
        UIImageView *_lineView;
    }
    
    @end
    
    @implementation NewsController
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        //设置导航栏颜色
        self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0];
        //设置背景颜色
        self.view.backgroundColor = [UIColor whiteColor];
        
        Sca1ViewController *sc1 = [[Sca1ViewController alloc]init];
        sc1.title = @"第一个";
        
        Sca2ViewController *sc2 = [[Sca2ViewController alloc]init];
        sc2.title = @"第二个";
        
        Sca3ViewController *sc3 = [[Sca3ViewController alloc]init];
        sc3.title = @"第三个";
        
        Sca4ViewController *sc4 = [[Sca4ViewController alloc]init];
        sc4.title = @"第四个";
        
        SCNavTabBarController *scaZhu = [[SCNavTabBarController alloc]init];
        scaZhu.subViewControllers = @[sc1, sc2, sc3, sc4];
        [scaZhu addParentController:self];
        //导航条下方的横线
        _lineView =  [self findlineviw:self.navigationController.navigationBar];
    }
    

    相关文章

      网友评论

          本文标题:IOS - 分段控制器SegmentedControl

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