测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布最新发布 | 2015年6月 |
由 Sebastian Suchanowski 维护。
THTinderNavigationController 通过 CocoaPods 提供。如果原作者 Tgy31 想为自己设置一个 pod,我在 pod 名称的末尾添加了我的推特名称。要安装它,只需将以下行添加到您的 Podfile 中
pod 'THTinderNavigationController-ssuchanowski'
创建一个 THTinderNavigationController
。
THTinderNavigationController *tinderNavigationController = [[THTinderNavigationController alloc] init];
THTinderNavigationController
可以接受任何 UIView
作为导航栏项。只需设置其 navBarItemViews
属性。
tinderNavigationController.navbarItemViews = @[
[[NavigationBarItem alloc] init],
[[NavigationBarItem alloc] init],
[[NavigationBarItem alloc] init]
];
为了根据其位置对视图进行动画,视图必须遵循 THTinderNavigationBarItem
协议中的 - (void)updateViewWithRatio:(CGFloat)ration
。
在演示中,为了更改颜色
- (void)updateViewWithRatio:(CGFloat)ratio
{
// Color change animation
self.coloredView.alpha = ratio;
}
在演示中,为了更改大小
- (void)updateViewWithRatio:(CGFloat)ratio
{
// Size change animation
ratio = ratio/2.0 + 0.5;
CGFloat height = self.frame.size.height * ratio;
CGFloat width = self.frame.size.width * ratio;
CGFloat x = (self.frame.size.width - width) / 2.0;
CGFloat y = (self.frame.size.height - height) / 2.0;
self.coloredView.frame = CGRectMake(x, y, width, height);
self.coloredView.layer.cornerRadius = height/2.0;
}