UISlider
a の開始位置(理想的には中央) を設定する方法と、1 ではなく 10 でインクリメントする方法を知っている人はいますか?
ここに私がこれまでに持っているものがあります:
// Setup custom slider images
UIImage *minImage = [UIImage imageNamed:@"ins_blueTrack.png"];
UIImage *maxImage = [UIImage imageNamed:@"ins_whiteTrack.png"];
UIImage *tumbImage= [UIImage imageNamed:@"slide.png"];
minImage=[minImage stretchableImageWithLeftCapWidth:6.0 topCapHeight:0.0];
maxImage=[maxImage stretchableImageWithLeftCapWidth:6.0 topCapHeight:0.0];
// Setup the slider
[self.slider setMinimumTrackImage:minImage forState:UIControlStateNormal];
[self.slider setMaximumTrackImage:maxImage forState:UIControlStateNormal];
[self.slider setThumbImage:tumbImage forState:UIControlStateNormal];
self.slider.minimumValue = 10;
self.slider.maximumValue = 180;
self.slider.continuous = YES;
int myVal = self.slider.value;
NSString *timeValue = [[NSString alloc] initWithFormat:@"%1d", myVal];
self.timeLabel.text = timeValue;
// Attach an action to sliding
[self.slider addTarget:self action:@selector(fxSliderAction) forControlEvents:UIControlEventValueChanged];