這是我當前如何做如何使應用程序UISlider snappy?
- (IBAction)sliderDistanceChanged {
CGFloat sliderPosition = self.sliderDistance.value;
NSUInteger sliderIndex = [BGDistanceFilterStop indexForFilterEffect:sliderPosition];
self.distanceFilterForCatalog = @([BGDistanceFilterStop numberValueOfDistance:sliderIndex]);
//self.distanceFilterForCatalog= @(self.sliderDistance.value).roundWithForDistanceFilter;
//[self.distanceFilter setTitle:self.distanceFilterForCatalog.distanceForm forState:UIControlStateNormal];
[self.distanceFilter setTitle:[BGDistanceFilterStop stringValueOfDistance:sliderIndex] forState:UIControlStateNormal];
}
- (IBAction)SliderNoLongerTouched:(id)sender {
CGFloat sliderIndex = [BGDistanceFilterStop sliderSnappedPosition:self.sliderDistance.value];
self.sliderDistance.value=sliderIndex;
}
它基本上檢測self.sliderDistance.value然後根據舍入後設置的報告值。
一旦用戶不再聯繫,我改變self.sliderDistance.value
的立場,即是罰款。
但是,我想在用戶修改之前更改self.sliderDistance.value。但是,這與iOS用於跟蹤滑塊的雙手位置和值的變量是相同的。
那麼,如何安排按鈕捕捉到正確的位置而不改變self.sliderDistance.value?
圖像的相關性是什麼? – ekhumoro 2017-02-20 19:54:27
@JimThio - 這個來自3年前問題的新答案僅僅是問題的重複?有一個很好但不相關的圖像? – foundry 2017-02-24 19:38:03