【发布时间】:2014-10-13 01:33:16
【问题描述】:
我是 iOS 开发的新手,遇到的问题很少。我不知道这种方法是好是坏,但我不想使用任何第三方。我想制作像 Facebook 侧边栏这样的侧边栏,我的代码是
- (IBAction)basicProfile:(id)sender {
menuViewController *destVC = [self.storyboard instantiateViewControllerWithIdentifier:@"menuView"];
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromLeft];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
CGRect view = self.view.frame;
view.origin.x = 280;
if(self.view.frame.origin.x > 100 )
{
[UIView beginAnimations:nil context:(__bridge void *)(self.scrollView)];
[UIView setAnimationDuration:0.25];
NSLog(@"%f", self.view.frame.origin.y);
self.view.frame = CGRectMake(0,0,320,568);
[UIView commitAnimations];
}
else{
[self.showView setHidden:NO];
[UIView beginAnimations:nil context:(__bridge void *)(self.scrollView)];
[UIView setAnimationDuration:0.25];
NSLog(@"%f", self.view.frame.origin.y);
self.view.frame = CGRectMake(280,0,320,568);
[UIView commitAnimations];
[self.view addSubview:destVC.view]; // this line added menuView to profile view but not on sidebar
}
}
我在 storyborad 中有两个 uiview,一个是配置文件,另一个是 menuViewController。为什么 menuView 没有正确加载 result of above code
【问题讨论】:
-
+1 : 我不想使用任何第三方
-
否 :( 我仍在搜索,但我暂时使用了这个 CDRTranslucentSideBar 库。
标签: ios uiviewanimation sidebar