2

私たちのアプリケーションでは、あるビューから別のビューへの移行に CATransition を使用していますが、他のアプリのように滑らかさがありません。したがって、ビュー遷移の代替ソリューションや、アプリケーション フローのスムーズさを改善するためのヒントとなるものがあります。

よろしく

ここで編集したのは、使用しているコードです。

MyView *obj =[[MyView alloc]initWithFrame:CGRectMake(0,0,320,415)];
CATransition *animation = [CATransition animation];
[animation setDuration:0.3];
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
[animation setType:kCATransitionPush]; 
[animation setSubtype:kCATransitionFromRight];  
[[self.superview layer] addAnimation:animation forKey:nil];

[self.superview addSubview:obj];
[obj release];

[self removeFromSuperview];
4

1 に答える 1

0

コード/背景情報がなければ、あなたを助けるのは難しいでしょうが、私が言えることの1つは、アニメーション中のラスタライズが大きな違いを生む可能性があるということです:

- (void)startAnimation {
    [myView.layer setShouldRasterize:YES]; //tell the layer to rasterize
    [myView.layer setRasterizationScale:[UIScreen mainScreen].scale]; //make sure it scales on retina devices

    double delayInSeconds = 0.1; // wait a bit to let it rasterize
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
    dispatch_after(popTime, dispatch_get_current_queue(), ^(void) {
        //do
        //your
        //animation
        //here

        //where you're animation is finished (i.e. in a completion block)
        //tell the layer not to rasterize anymore
        [myView.layer setShouldRasterize:NO];
    }
}
于 2012-08-15T14:47:59.723 に答える