質問

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