2015-08-31 115 views
1

我想实现面板,默认情况下从底部出现只有1/4。 而当我点击这个部分,或者滑动它时,它应该全屏滚动。面板从底部滑动

正是我想要的在这个app

被实施所以我已经试过: 制作的UIView,并试图运用轻触和滑动手势。 UIView没有收到它。但它捕捉触动移动,touchesEnded等 UITableView。相同。 制作UIViewController。完全没有任何想法如何处理它以正确的方式。

因此,任何想法或链接表示赞赏。 在此先感谢。

回答

0

检查PPRevealSideViewController https://github.com/ipup/PPRevealSideViewController,我想你可以找到你需要的东西。 当您点击新的viewController时,您可以更改偏移量。

AppDelegate.m

MainViewController *main = [[MainViewController alloc] init]; 
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 
main = [storyboard instantiateViewControllerWithIdentifier:@"MainViewControllerr"]; 
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:main]; 
_revealSideViewController = [[PPRevealSideViewController alloc] initWithRootViewController:nav]; 
_revealSideViewController.delegate = self; 
self.window.rootViewController = _revealSideViewController; 

MainViewController.m

-(void)popViewController{ 
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 
    PoppedViewController *pvc = [storyboard instantiateViewControllerWithIdentifier:@"PoppedViewController"]; 
    [self.revealSideViewController pushViewController:pvc onDirection:PPRevealSideDirectionBottom withOffset:_offset animated:_animated completion:nil]; 
} 

PoppedViewController.m

-viewDidLoad{ 
    //... 
    UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(getFullView)]; 
    gesture.delegate = self; 
    [self.view addGestureRecognizer:gesture]; 
} 

-getFullView{ 
    [self.revealSideViewController changeOffset:0.0f forDirection:PPRevealSideDirectionLeft]; 
} 
+0

当我尝试设置(安装pod后),我得到文件未找到。你可以帮我吗? – IgorNikolaev

+0

好吧,也许你没有写出正确的pod文件。检查此解决方案:http://stackoverflow.com/questions/25970560/prefix-pch-reactivecocoa-racextscope-h-file-not-found-error/26162228#26162228 – euthimis87

+0

没有工作。我写了pod'link_with ['test','testTests'] platform:ios pod'PPRevealSideViewController','〜> 1.1'。因为1.2.1没有安装。 – IgorNikolaev