在 UITableView 和 MapView 之间创建一个视差效果,就像 Foursquare 中的视图。
示例用法可在 SLAppDelegate
中找到。
SLParallaxController
使用 ARC 且需要 iOS 7.0+。适用于 iPhone 和 iPad。
需要 MapKit
框架
将 SLParallaxController
文件夹复制到您的项目。
SLParallaxController
是 UIViewController
的子类,因此您只需像这样实例化一个新的 [SLParallaxController new]
您可以通过设置以下属性来自定义视图
- heighTableViewHeader : Height of the visible map on high position
- Y_tableViewOnBottom : position of the TableView when it's down
- minYOffsetToReach : The minimum Y (TableView's contentOffset)
to allow the 'displaying' of the map.
当用户点击地图或 tableView 时,在这些方法中定义的 SLParallaxControllerDelegate
协议会在代理上调用。
-(void)didTapOnMapView;
-(void)didTapOnTableView;
当 tableView 向下或向上移动时,在这些方法中定义的 SLParallaxControllerDelegate
协议会在代理上调用。
-(void)didTableViewMoveDown;
-(void)didTableViewMoveUp;
Copyright (c) 2014 stefanlage
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.