分段

作者: 0bf43b438419 | 来源:发表于2019-04-22 09:21 被阅读0次

#import "XLSlideSwitch.h"
#import "RDViewController.h"
#import "TJViewController.h"
#import "YLViewController.h"
#import "SPViewController.h"
#import "DYViewController.h"
#import "SJViewController.h"
@interface oneViewController ()<XLSlideSwitchDelegate>{
    UIView  * Someview;   //是点击加号的按钮
}
@property(nonatomic,strong)XLSlideSwitch *  GDview; // 滚动视图

@end

@implementation oneViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title =  @"首页";
    //    self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
    //分段控制器
    //创建一个数组
    NSArray  * arr =@[@"推荐",@"热点",@"娱乐",@"视频",@"订阅",@"事件"];
   
    //数组
    NSArray  * array =@[@"RDViewController",@"TJViewController",@"YLViewController",@"SPViewController",@"DYViewController",@"SJViewController"];
   
    //可变数组
   
    NSMutableArray   *  viewcontroller = [[NSMutableArray alloc] init];
   
    //创建一个for循环
    for(int  i = 0; i<arr.count; i++){
        //字符串控制器
        UIViewController  *  VC = [[NSClassFromString(array[i])alloc] init];
        //添加
        [viewcontroller   addObject:VC];
    }
    //滚动视图
    _GDview  = [[XLSlideSwitch alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, self.view.bounds.size.height - 64) Titles:arr viewControllers:viewcontroller];
    //代理
    _GDview.delegate=self;
   
    //颜色
    _GDview.itemNormalColor=[UIColor darkGrayColor];
   
    _GDview.itemSelectedColor = self.navigationController.navigationBar.tintColor;
    //设置控件的距离
    _GDview.customTitleSpacing = 30;
   
    [_GDview showInViewController:self];
   
   
    Someview = [[UIView alloc] initWithFrame:CGRectMake(self.view.bounds.size.width - 150, 104, 140, 200)]; Someview.backgroundColor = [UIColor orangeColor];
    for (int i = 0 ; i < 1; i ++) { [self.view addSubview:Someview];
       
        Someview.backgroundColor = [UIColor orangeColor];
       
        for (int i = 0 ; i < 1; i ++) {
            [self.view addSubview:Someview];
            Someview.hidden = 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.
}
*/

相关文章

  • 世界你好分段计费is分

    世界你好分段计费is分 世界你好分段计费is分世界你好分段计费is分世界你好分段计费is分世界你好分段计费is分世...

  • 【一模排名】2019年海淀区初三一模区排名出炉

    海淀区初三一模区排名 语文英5分段 语文5分段 数学5分段 英语5分段 物理5分段 化学5分段 生物5分段 道德与...

  • u3t2

    90…分段…3个 80…分段…11个 70.分段..9个 60…分段…8个 不及格……10个

  • 分段

    #import "XLSlideSwitch.h"#import "RDViewController.h"#imp...

  • 分段

    人类社会的整个历史,依不同的标准,可以分成不同的段落,由此衍生出历史学家编制历史的不同方法:通史,断代史,编年体,...

  • 分段思维

    循序渐进就是分段思维 的应用。要学会把困难的事情分段,要学会把长时间的事情分段,要学会把长远的目标分段。 可以看...

  • 锁 - 分段锁

    分段锁 典型的乐观锁:ConcurrentHashMap ConcurrentHashMap分段锁代替HashTa...

  • LearningR-math

    1. integrate函数 2. 举例 2.1 分段函数求积分 分段函数的参数有11组,在每组参数下求出分段函数...

  • Swift For in & repeat while 循环

    for in 循环字典 输出结果 for in 分段区间: 开区间 for in 分段区间: 闭区间 repeat...

  • 基于MACD分波段

    指标介绍 分段方法 分段规则 分段算法 寻找可疑拐点 然后上述算法表述并不完整,与其结果有出入,若严格按照上述算法...

网友评论

      本文标题:分段

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