我是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
最佳答案
有两种方法可以做到这一点:
关于ios - ios7中的自定义边栏,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26322634/