임은 현재 보편적 인 응용 프로그램 작업을 회전시킬 때의 CALayer은 매우 랙이 만들고, 나는 다음과 같은 XIB가 내보기 컨트롤러 중 하나에 : 내있는 viewDidLoad 방법에아이 패드 응용 프로그램 -
View
-ImageView
-TableView
-ImageView
-View (called tblviewContainer in the following snippet of code)
을 나는 계층을 만들었습니다 화면의 상단과 하단이 그래디언트가되도록 내보기 (tblviewcontainer)에 넣을 것입니다. 내 응용 프로그램에서
[tblViewContainer addSubview:self.tableView];
[tblViewContainer sendSubviewToBack:self.tableView];
if (!maskLayer)
{
maskLayer = [CAGradientLayer layer];
UIColor* outerColorSetup = [UIColor colorWithWhite:1.0 alpha:0.0];
UIColor* innerColorSetup = [UIColor colorWithWhite:1.0 alpha:1.0];
CGColorRef outerColor = outerColorSetup.CGColor;
CGColorRef innerColor = innerColorSetup.CGColor;
maskLayer.colors = [NSArray arrayWithObjects:
(__bridge id)outerColor,
(__bridge id)innerColor,
(__bridge id)innerColor,
(__bridge id)outerColor, nil];
maskLayer.locations = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.01],
[NSNumber numberWithFloat:0.04],
[NSNumber numberWithFloat:0.8],
[NSNumber numberWithFloat:1.0], nil];
maskLayer.bounds = CGRectMake(0, 0,
self.tableView.frame.size.width,
self.tableView.frame.size.height);
maskLayer.anchorPoint = CGPointZero;
tblViewContainer.layer.mask = maskLayer;
}
이 회전 가능하며, 내가의 층으로 그렇게 할 때 회전 할 때, 그것은 랙이/매우 느립니다 (만 아이 패드 3에!).
나는 다음과 같이 회전 할 때 : (portrait-에서> 풍경)
-(void)willRotateToInterfaceOrientation: (UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration
{
if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown)
{
}
else if(orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight)
{
_landscape = [[ipad_VideoListViewController_Landscape alloc] initWithNibName:@"ipad_VideoListViewController_Landscape" bundle:nil];
_landscape.scroolViewContentOffset = scroolViewContentOffset;
[self.view.layer setRasterizationScale:[UIScreen mainScreen].scale];
self.view.layer.shouldRasterize = YES;
NSMutableArray *viewCons = [[[self navigationController]viewControllers] mutableCopy];
[viewCons removeLastObject];
[viewCons addObject:_landscape];
[[self navigationController]setViewControllers:viewCons animated:NO];
}
}
최악의 일부가 활성 레이어와 아이 패드 2에 완벽하게 작동하지만, 아이 패드 3 캔트 그것을 처리하는 것. 심지어 ipad 2 (작동)에서 애니메이션으로하는 일은 ipad에서 처리 할 수 없다. 나는 자신의 tableview 헤더 셀/tableview 셀을 만들었고 ipad 3에서 사용하면 지연됩니다.
도움이 될만한 도움이 될 것입니다!
다음 두 줄을 추가했습니다. (to willrotate) [self.view.layer setRasterizationScale : [UIScreen mainScreen] .scale]; self.view.layer.shouldRasterize = YES; 그리고 다음 줄을 참고하십시오 : self.view.layer.shouldRasterize = NO; 매우 도움이 되었기 때문에 여전히 원활하지 않았습니다. – Lasse