任何人都知道如何实现像viewController没有全屏,就像当我们在iPhone中搜索时点击? 我希望当用户向上滑动viewController(半高)显示。 没有segue!我希望同时显示旧的视图控制器。 在此先感谢viewController没有全屏
0
A
回答
1
我添加这种类型的对整个项目的功能,我添加了QRView的窗口,使用户SWIP了从项目的任何观点认为...
见我的代码示例..
刚刚成立在UISwipeGestureRecognizer
你的第二个观点要提出像波纹管......
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setType:kCATransitionFade];
[animation setDuration:0.5];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:
kCAMediaTimingFunctionEaseInEaseOut]];
[[self.view layer] addAnimation:animation forKey:kAnimationKey];
UISwipeGestureRecognizer *swipeGesture = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(addCustomBottomBar)] autorelease];
swipeGesture.numberOfTouchesRequired = 1;
swipeGesture.direction = (UISwipeGestureRecognizerDirectionDown);
[yourViewController.view addGestureRecognizer:swipeGesture];/// use your view name here, its depends on your requirement
UISwipeGestureRecognizer *swipeGestureTop = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(addCustomBottomBar)] autorelease];
swipeGestureTop.numberOfTouchesRequired = 1;
swipeGestureTop.direction = (UISwipeGestureRecognizerDirectionUp);
[yourViewController.view addGestureRecognizer:swipeGestureTop];
,这时候你向上轻扫观点称为波纹管的方法...
而且只需添加一个BOOL
变量名称为isViewPop
个它在你的viewDidLoad:
方法设置为NO
..
-(void)addCustomBottomBar{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.window cache:YES];
if (isqrcodepop) {
isViewPop=NO;
yourViewController.view.frame=CGRectMake(0, 430, 320, 70);
}
else{
isViewPop=YES;
yourViewController.view.frame=CGRectMake(0, 210, 320, 270);
[self.view bringSubviewToFront:yourViewController.view];
}
[UIView commitAnimations];
}
我希望这个答案对你有帮助...
0
您可以有背景视图控制器[self presentViewController:vc animated:YES completion:nil];
并将您的前视图控制器的框架设置为屏幕的一半。这样,由于前视图的下半部分是透明的,所以您的背景视图控制器仍然可见
1
如果它是简单的,我会添加一个UIView
到您的UIViewController
的底部 - 然后当您点击“搜索“也好,动画效果UIView
起来查看与动画块:
- (IBAction)btnTouch:(id)sender
{
[UIView animateWithDuration:0.3
delay:0.0
options: UIViewAnimationCurveEaseInOut
animations:^{
//bring searchView up
_searchView.transform = CGAffineTransformMakeTranslation(0, -80);
}
completion:^(BOOL finished){
}
];
}
然后,当你完成后,使用相同的动画块这一行,而不是推的观点回到原点:
_searchView.transform = CGAffineTransformMakeTranslation(0, 0);
+0
完美非常感谢RyanG! –
相关问题
- 1. presentModalViewController没有全屏
- 2. GridLayout没有显示全屏?
- 3. ViewController没有segue,swift
- 4. 安卓:全屏对话框没有真正全屏
- 5. 全屏没有导航和状态栏
- 6. Mac OpenGL:全屏没有音量覆盖
- 7. 全屏加载视图没有工作
- 8. 全屏没有反应时的ActionScript3
- 9. 场景没有完全填满屏幕
- 10. JFrame在全屏幕没有undecorated
- 11. 没有AJAX的iPhone全屏webapp
- 12. Youtube Iframe没有全屏按钮
- 13. Iphone上没有全屏的YouTube iframe API
- 14. 该应用没有转到全屏幕
- 15. 的WebView没有采取全屏
- 16. 视频没有在全屏播放?
- 17. IOS - 没有全屏webview的“touchend”事件
- 18. 图像没有采用CSS全屏
- 19. Android窗口没有给我全屏
- 20. setWallpaper(bitmap)没有设置全屏壁纸?
- 21. ViewController中没有导航控制器的屏幕方向
- 22. 有没有办法在全屏时完全隐藏YouTube控件?
- 23. ViewController没有显示... Xcode iPhone
- 24. ViewController Modal Presentation没有出现
- 25. 类的ViewController没有intitalizers
- 26. UIButton没有出现在viewController
- 27. ViewController没有响应触摸
- 28. 从全屏控制器到tabbarcontroller的viewcontroller导航模式
- 29. 半屏视图vs viewController
- 30. 将NSString从一个viewController传递到另一个viewController没有IBAction
非常感谢Paras Joshi! –