장치가 회전 할 때 hostingView의 프레임을 변경할 수 있습니다.
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator: (id<UIViewControllerTransitionCoordinator>)coordinator {
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
[self.hostingView setFrame:[self.view bounds]];
}];
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
}
그러면 가로보기로 변경됩니다.
그래프를 그리기 전에 장치를 세로로 유지해야합니다. 보기 컨트롤러를 설정해야합니다. 그렇지 않으면, 플롯이 가로 모드에서 세로 크기로 설정된다는 버그와 같은 것이 있습니다.
-(void)viewDidLayoutSubviews {
[self.hostingView setFrame:[self.view bounds]];
}
나는 어디에서 무슨 일이 일어나고 있는지 알 수있는 휴식 지점을 둘 수 있다고 생각하지 않습니까? – user2196409
'- [CPTLayer layoutSublayers]'에 중단 점을 넣을 수는 있지만 코어 플롯이하는 일을 보여줄뿐입니다. UIKit은 스토리 보드와 뷰 컨트롤러를 통해 대부분의 작업을 처리합니다. –