Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在视图中添加了一个 UISlider 并为 UIControlEventvaluechanged 提供了方法,因为我想更新我的 UILabel 值。但我想要滑块的最后更改值,以便当用户最终选择滑块的值时,我可以调用一个方法并将值传递给它。
尝试这个:
- (IBAction) sliderValueChanged:(UISlider *)sender { label.text = [NSString stringWithFormat:@"%f", slider.value]; }