TCParallax
Parallax scrolling effect on UITableView header view when a tableView is scrolled
Install / Use
/learn @itanchao/TCParallaxREADME
TCParallax
写在前面:
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;
}

Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
