Domanda

I'm using ecslidingviewcontroller 2, which removed anchortopviewoffscreen methods.

What's the best way to move top view off screen to make room for search in the menu view controller?

Thank you.

È stato utile?

Soluzione

Here's what I ended up doing:

UIViewController *topViewController = self.slidingViewController.topViewController;

CGFloat dX = self.view.frame.size.width - self.slidingViewController.anchorRightRevealAmount;

// You can replace kSearchAnimationDuration with 0.25 or define it somewhere
[UIView animateWithDuration:kSearchAnimationDuration animations:^{

    topViewController.view.layer.transform = CATransform3DTranslate(topViewController.view.layer.transform, dX, 0, 0);        
}];

let me know if you have a better method.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top