Tôi gặp phải sự cố lạ với khối hoạt ảnh trên iPhone. Mã này:UIView animateWithDuration: delay: working weird
[UIView animateWithDuration:2 delay: 0 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor blueColor]]; }
completion: nil];
[UIView animateWithDuration:2 delay: 2 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor redColor]]; }
completion: nil];
Ngay lập tức đặt nền thành màu đỏ, không chuyển trạng thái xanh lam. Điều tương tự ngay cả đối với mã này:
[UIView animateWithDuration:2 delay: 0 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor blueColor]]; }
completion:
^(BOOL wrwg) {
[UIView animateWithDuration:2 delay: 2 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor redColor]]; }
completion: nil];
}];
Đó là, nơi tôi cố gắng chạy các hình ảnh động thứ hai sau khi người đầu tiên đã kết thúc. Có vấn đề gì?
Loại đối tượng nào là bộ điều khiển? Một UIView, UILabel, khác? – Anna