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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top