实际上我有一个带有选项的表格 View ,但我还有一个复杂的滚动设计。我该如何实现这个滚动条?
Best Answer-推荐答案 strong>
创建UISlider 垂直
- (void)viewDidLoad
{
[super viewDidLoad];
[self addSliderVertical];
}
-(void) addSliderVertical{
slider=[[UISlider alloc]initWithFrame:CGRectMake(20, 40, 300, 300)];// set fram your require position
CGAffineTransform trans=CGAffineTransformMakeRotation(M_PI_2);
slider.transform=trans;
[self.view addSubview:slider];
slider.minimumValue=1;
slider.maximumValue=100;
slider.continuous=NO;
[slider addTarget:self actionselector(sliderChanhge forControlEvents:UIControlEventValueChanged];
}
slider 更换方法
-(IBAction)sliderChanhgeid)sender
{
// here change tableview scroll offset
[self.tableView setContentOffset:CGPointMake(0, (int)slider.value) animated: YES];
}
关于ios - 如何在IOS或类似的东西中实现这个自定义滚动条?,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/30798804/
|