[英]Modal View Controller with MapView And TableView
I'm looking to replicate the basic functionality of the Stores finder in the new Starbucks app (MapView with a tableview bellow it) but am unsure as to how I would go about implementing the sliding aspect of presenting the view 我正在寻找在新的星巴克应用程序中复制商店查找器的基本功能(MapView带有表格视图),但不确定如何实现呈现视图的滑动方式
The main aspect of the functionality I am trying to replicate is the ability to present the modal and have it dismissible by sliding it down off the screen as I am able to replicate the Map + Table view already 我要复制的功能的主要方面是能够呈现模式并通过将其从屏幕上向下滑动来使其消失的能力,因为我已经能够复制Map + Table视图
https://www.cocoacontrols.com/controls/kipulltoreveal只需创建一个自定义单元,即可使其完全相同。
Well from the Gif you posted, It seems that Starbucks just present the view controller modally which is very easy to do. 从您发布的Gif来看,星巴克似乎只是模态地呈现了视图控制器,这很容易做到。
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
YourViewController *yourVC= (YourViewController *)
[storyboard instantiateViewControllerWithIdentifier:@"yourView"];
[self presentViewController:yourVC animated:YES completion:nil];
As for dissmissing the view you would need to set ViewController's
interactivePopGestureRecognizer delegate to self and then handle its behavior in -gestureRecognizerShouldBegin: 至于关闭视图,您需要将
ViewController's
InteractivePopGestureRecognizer委托设置为self,然后在-gestureRecognizerShouldBegin中处理其行为:
That is, when you want the built-in pop gesture ( – popViewControllerAnimated: ) to fire, you must return YES from this method. 也就是说,当您要触发内置弹出手势( – popViewControllerAnimated:)时 ,必须从此方法返回YES。 The same goes for your custom gestures - you have to figure out which recognizer you are dealing with.
自定义手势也是如此-您必须弄清楚正在处理的识别器。
My thought is this is just a viewcontroller containing 2 basic views: 我的想法是,这只是一个包含2个基本视图的ViewController:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.