tôi muốn tạo hiệu ứng động cho UISlider cho ví dụ: 0,25 đến 0,75 và ngược lại. Điều này sẽ cho người dùng biết phải làm gì.Animate UISlider trơn tru
tôi đã cố gắng này:
[self incrementCounter:[NSNumber numberWithInt:0]];
-(void) incrementCounter:(NSNumber *)i {
[Slider setValue:[i floatValue]/1000];
[self performSelector:@selector(incrementCounter:) withObject:[NSNumber numberWithInt:i.intValue+1] afterDelay:0.001];
}
nhưng thats không quá trơn tru ... tôi có thể sử dụng hiệu ứng chuyển tiếp cho việc này?
[Slider setValue:1 animated:YES];
là để nhanh chóng ...
[UIView animateWithDuration:2.0
animations:^{
[Slider setValue:0.2];
}];
[UIView animateWithDuration:2.0
animations:^{
[Slider setValue:0.5];
}];
Chỉ cần sinh động một giây ...