开发者

PAGECURL ANIMATION SUBTYPE

开发者 https://www.devze.com 2023-01-18 11:06 出处:网络
I know this has been asked a thousand times and people will say that the @pagecurl will get rejected.

I know this has been asked a thousand times and people will say that the @pagecurl will get rejected.

I tried reasoning with the client but they insist they want to push the app with that function in and it will have a chance of not being rejected.

The problem is that if I try animation.subtype , the animation will not listen to it. I.e if I have the orientation mode in landscape, the page curl 开发者_JAVA技巧will start from some other position even if I try setting the animationsubtype.

Anyone knows what I can do about that ?

The code is below:

CATransition *animation = [CATransition animation];
  [animation setDelegate:self];
  // animation.subtype = kCATransitionFromTop;

  if(rotation == UIInterfaceOrientationPortraitUpsideDown){
   animation.subtype = kCATransitionFromLeft;
  }else if(rotation == UIInterfaceOrientationPortrait){
   animation.subtype = kCATransitionFromRight;
  }else if(rotation == UIInterfaceOrientationLandscapeRight){
   animation.subtype = ....
  }else if(rotation == UIInterfaceOrientationLandscapeLeft){

   animation.subtype = ....
}

animation setDuration:0.35];
        [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
        animation.type = @"pageCurl";

The top 2 seems to work but I can't change it when the orientation is in landscape mode.

Many thanks.


There are methods of doing this without the private API, and I'm building one myself to allow me to use any UIView and not just a CALayer with the Page Curl effect. Your best bet is to use Leaves, or PageCurl from Github. They're pre-planned for use with images, PDFs, and simple graphics as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消