-1
如何創建滑塊和滑動值增加了10,20,30 ...... &下降了-10 ,-20,-30 ...這種格式。幫助任何其他鏈接的教程或源代碼。感謝提前
如何創建滑塊和滑動值增加了10,20,30 ...... &下降了-10 ,-20,-30 ...這種格式。幫助任何其他鏈接的教程或源代碼。感謝提前
UISlider* mySlider = [[UISlider alloc] init];
mySlider.minimumValue = -30.0f;
mySlider.maximumValue = 30.0f;
-(IBAction) sliderChanged:(id) sender{
UISlider *slider = (UISlider *) sender;
int progressAsInt =(int)(slider.value + 0.5f);
NSString *newText =[[NSString alloc]
initWithFormat:@"%d",progressAsInt];
self.sliderLabel.text = newText;
}
OP詢問有+/- 10增量/減量的滑塊... –
'UISlider'因爲不提供'step'功能 - 您必須對其進行子類化(或向使用它的類添加委託方法)。 –