为 UITableView 和 UIScrollViews 重新创建 Twitter 的个人资料页滚动动画。该库使用 Core graphics 框架,基于 thinkandbuild.it 的 Swift 教程 转换为 Obj-C 开发。
将 MBTwitterScroll 文件夹的源代码复制到您的项目。
导入项目
#import "MBTwitterScroll.h"
要在 UITableVIew 上显示动画,请使用以下代码
MBTwitterScroll *myTableView = [[MBTwitterScroll alloc]
initTableViewWithBackgound:[UIImage imageNamed:@"your image"]
avatarImage:[UIImage imageNamed:@"your avatar"]
titleString:@"Main title"
subtitleString:@"Sub title"
buttonTitle:@"Follow"]; // Set nil for no button
myTableView.delegate = self;
[self.view addSubview:myTableView];
要在 UIScrollView 上显示动画,请使用以下代码
MBTwitterScroll *myScrollView = [[MBTwitterScroll alloc]
initScrollViewWithBackgound:nil
avatarImage:[UIImage imageNamed:@"avatar.png"]
titleString:@"Main title"
subtitleString:@"Sub title"
buttonTitle:@"Follow" // // Set nil for no button
contentHeight:2000];
myScrollView.delegate = self;
[self.view addSubview:myScrollView];
MBTwitterScroll 可免费用于所有用途,根据 MIT 许可协议提供。有关更多信息,请参阅 LICENSE 文件。
有关问题或功能,请通过 @martinblampied 联系我。