IOS - 分段控制器SegmentedControl

首先导入#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];
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 写文章[https://www.jianshu.com/writer#/] 发现[https://www.jian...
    牛小牛啊阅读 593评论 0 3
  • 转载:https://blog.csdn.net/xoxo_x/article/details/52695032 ...
    遵天循道阅读 6,711评论 3 19
  • http://blog.csdn.net/kangguang/article/details/51658683 G...
    Skylpy阅读 1,269评论 0 0
  • 你是西北的一颗明珠, 东千佛洞, 西千佛洞. 有了“敦煌” 美丽的名字。 在你 飘飞的衣袖中 读出了 玄奘西行的漫...
    莲花白雪阅读 369评论 0 1
  • 夜幕将蓝天撕裂 煌煌大日疲惫成烛光 冰雪覆盖的世界喝醉了酒 远山不见 仅存的几只喜鹊 到处找食 十几厘米的雪被扒开...
    杜fiao阅读 251评论 4 5