sadasd

#import "ViewController.h"
#import "DLViewController.h"
//导入三方文件
#import "XLSlideSwitch.h"
#import "RDViewController.h"
#import "SPViewController.h"
#import "JQViewController.h"
#import "LSViewController.h"
#import "YCViewController.h"
#import "TZViewController.h"




@interface ViewController (){
    UIView  * Someview;   //是点击加号的按钮
}

@property(nonatomic , strong)XLSlideSwitch *GDview;///滚动视图

@end

@implementation ViewController





- (void)viewDidLoad {
    [super viewDidLoad];
    //创建一个数组用过来储存名字
    NSArray * arr =@[@"热点",@"视频",@"军情",@"历史",@"原创",@"图组"];
   
    NSArray * array =@[@"RDViewController",@"SPViewController",@"JQViewController",@"LSViewController",@"YCViewController",@"TZViewController"];
    //可变的数组
    NSMutableArray * viecontroller =[[NSMutableArray alloc]init];
   
   
    //创建一个for
   
    for (int i = 0; i       
        //字符串控制器
        UIViewController * VC =[[NSClassFromString(array[i])alloc]init];
        //添加
        [viecontroller addObject:VC];

    }
   
    //滚动视图
    _GDview  = [[XLSlideSwitch alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, self.view.bounds.size.height - 64) Titles:arr viewControllers:viecontroller];
    //代理
    _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;
        }

    self.navigationController.navigationBar.barTintColor = [UIColor blueColor];

你可能感兴趣的:(sadasd)