[英]Modal View Controller with MapView And TableView
我正在尋找在新的星巴克應用程序中復制商店查找器的基本功能(MapView帶有表格視圖),但不確定如何實現呈現視圖的滑動方式
我要復制的功能的主要方面是能夠呈現模式並通過將其從屏幕上向下滑動來使其消失的能力,因為我已經能夠復制Map + Table視圖
https://www.cocoacontrols.com/controls/kipulltoreveal只需創建一個自定義單元,即可使其完全相同。
從您發布的Gif來看,星巴克似乎只是模態地呈現了視圖控制器,這很容易做到。
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
YourViewController *yourVC= (YourViewController *)
[storyboard instantiateViewControllerWithIdentifier:@"yourView"];
[self presentViewController:yourVC animated:YES completion:nil];
至於關閉視圖,您需要將ViewController's
InteractivePopGestureRecognizer委托設置為self,然后在-gestureRecognizerShouldBegin中處理其行為:
也就是說,當您要觸發內置彈出手勢( – popViewControllerAnimated:)時 ,必須從此方法返回YES。 自定義手勢也是如此-您必須弄清楚正在處理的識別器。
我的想法是,這只是一個包含2個基本視圖的ViewController:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.