Question

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.

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top