Latest 2.0.3
Homepage https://github.com/itanchao/TCParallax
License MIT
Platforms ios 8.0
Authors

写在前面:

Parallax scrolling effect on UITableView header view when a tableView is scrolled

使用

platform :ios, ‘8.0’ 
use_frameworks!
target "TCParallaxExample" do
    pod 'TCParallax'
end

API

 ///  创建一个只有一张图片的headerView
 ///
 ///  - parameter image:     要展示的图片
 ///  - parameter forSize:   view大xiao
 ///  - parameter referView: 依赖view(headerView会依赖于这个view形变)
static func creatParallaxScrollViewWithImage(image:UIImage,forSize:CGSize,referView:UIScrollView?) -> ParallaxScrollView 

 ///  将一个view改造成ParallaxView
 ///
 ///  - parameter subView:   view
 ///  - parameter referView: 依赖view(headerView会依赖于这个view形变)
static func creatParallaxScrollViewWithSubView(subView:UIView,referView:UIScrollView) -> ParallaxScrollView 

使用

Swift

let headerView = ParallaxScrollView.creatParallaxScrollViewWithImage(UIImage(named: "imageDemo.jpg")!, forSize: CGSize(width: tableView.bounds.width, height: 300),referView: tableView) 
tableView.tableHeaderView = headerView

Object-C

- (UITableView *)tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
        _tableView.tableHeaderView = [ParallaxScrollView creatParallaxScrollViewWithSubView:self.headerView referView:_tableView];
        _tableView.backgroundColor = [UIColor whiteColor];
        _tableView.rowHeight = 45;
        _tableView.delegate = self;
        _tableView.dataSource = self;
    }
    return _tableView;
}
- (EditeUserHeaderView *)headerView{
    if (!_headerView) {
        _headerView = [[EditeUserHeaderView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 167)];
        _headerView.backgroundColor = Color(@"#040406");
        _headerView.delegate = self;
         _headerView.user = self.user;
    }
    return _headerView;
}

solarized vim

Latest podspec

{
    "name": "TCParallax",
    "version": "2.0.3",
    "summary": "Parallax scrolling effect on UITableView header view when a tableView is scrolled",
    "homepage": "https://github.com/itanchao/TCParallax",
    "license": "MIT",
    "authors": {
        "u8c08u8d85": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/itanchao/TCParallax.git",
        "tag": "2.0.3"
    },
    "source_files": [
        "Sauces",
        "Sauces/*.{swift}"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This