SVSegmentedControl 标签页

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
   
   //初始化背景图
    [self initBackgroundView];
  
}
#pragma -makr -funcitons
-(void)initBackgroundView
{
    SVSegmentedControl *options = [[SVSegmentedControl alloc] initWithSectionTitles:[NSArray arrayWithObjects:@"购车应用",@"车主应用", nil]];
    options.center=CGPointMake(160, 100);
    [options setSelectedSegmentIndex:0 animated:NO];
    [options addTarget:self action:@selector(segmentedControlChangedValue:) forControlEvents:UIControlEventValueChanged];
    [self.view addSubview:options];
   

}
#pragma -mark -doClickAction
- (void)segmentedControlChangedValue:(SVSegmentedControl*)segmentedControl {
    NSLog(@"--index--%i-", segmentedControl.selectedSegmentIndex);
}

posted @ 2014-11-24 15:16  銱ル╬鎯噹  阅读(213)  评论(0编辑  收藏  举报