2015-11-04 13 views
5

Tôi có một bảng phân cảnh với các phân đoạn khác nhau để đẩy ViewControllers trong NavigationController.iOS vô hiệu hóa hoạt ảnh push segue

Trong kịch bản tôi tàn tật Animation:

enter image description here

Tuy nhiên việc đẩy mạnh vẫn còn hiệu ứng động. Tại sao?

Trả lời

3

Hoạt ảnh đó là hành vi mặc định. Bạn cần phải tạo một UIStoryBoardSegue tùy chỉnh như sau:

PushNoAnimationSegue.h là:

#import <UIKit/UIKit.h> 

@interface PushNoAnimationSegue : UIStoryboardSegue 

@end 

PushNoAnimationSegue.m là:

#import "PushNoAnimationSegue.h" 

@implementation PushNoAnimationSegue 

-(void) perform{ 
    [[[self sourceViewController] navigationController] pushViewController:[self destinationViewController] animated:NO]; 
} 

@end 

Đối với mỗi Segue bây giờ thay đổi lớp với trang này bạn chỉ cần đã tạo và chọn "tùy chỉnh" trong trình đơn loại thả xuống.

Các vấn đề liên quan