-7

*在 iOS 自定义滑块中? 我怎样才能在 iphone 中制作这种类型的自定义滑块,它可以从左侧和右侧扩展?

4

2 回答 2

2

请通过这个示例项目..它可能会满足您的要求..

检查这个

只需导入 ARangeSlider 类并使用此代码..

ASRangeSlider *slider1 = [[ASRangeSlider alloc] initWithSpectrum:FloatRangeMake(0.0,f)];
[slider1 setThumbBackgroundImage:[UIImage imageNamed:@"GreenImage.png.png"]];
frame.size = self.BlackBackGround.frame.size;
slider1.frame = frame;
[BlackBackGround addSubview:self.slider1];
[slider1 addTarget:self action:@selector(slider1ValueChanged:) forControlEvents:UIControlEventValueChanged];
slider1.value=FloatRangeMake(0.0,f);

-(Void) slider1ValueChanged : (id) sender
{
    CGRect changedFrame = slider1.activeAreaView.frame; // this is your changed frame
    // change the frames of your green image using this frame
}
于 2013-01-25T09:50:07.283 回答
0

还有很多其他的图书馆。例如: https ://github.com/cmezak/CMRangeSlider或 https://github.com/buildmobile/iosrangesliderhttps://github.com/muZZkat/NMRangeSliderhttps://github.com/evadne/RARangeSlider

于 2013-01-25T09:58:32.220 回答