MEVFloatingButton 1.3

MEVFloatingButton 1.3

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最后发布2016 年 8 月

Manuel Escrig 维护。




一个 iOS 直接 UITableView, UICollectionView, UIScrollView 父类 分类,用于在顶部显示可定制的悬浮按钮。

feb 22 2016 14 17

特点

  • 多种动画类型。
  • 不同的显示模式。
  • 不同的屏幕位置。
  • 可定制的按钮图标。
  • 多个代理方法。

演示

演示应用

使用方法

要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install

要求

需要 iOS SDK 版本 > 8.0

安装


手册

简单地将 /Pod/Classes/ 文件夹中的 UIScrollView+FloatingButton.hUIScrollView+FloatingButton.m 包含到您的 App 的 Xcode 项目中。

如何使用


步骤 1
#import "UIScrollView+FloatingButton.h"
步骤 2

添加数据源和代理方法。

@interface ViewController () <MEVFloatingButtonDelegate>
#pragma mark - MEScrollToTopDelegate Methods

- (void)floatingButton:(UIScrollView *)scrollView didTapButton:(UIButton *)button;
- (void)floatingButtonWillAppear:(UIScrollView *)scrollView;
- (void)floatingButtonDidAppear:(UIScrollView *)scrollView;
- (void)floatingButtonWillDisappear:(UIScrollView *)scrollView;
- (void)floatingButtonDidDisappear:(UIScrollView *)scrollView;
步骤 3

创建一个 MEVFloatingButton 对象。

MEVFloatingButton *button = [[MEVFloatingButton alloc] init];
button.animationType = MEVFloatingButtonAnimationFromBottom;
button.displayMode = MEVFloatingButtonDisplayModeWhenScrolling;
button.position = MEVFloatingButtonPositionBottomCenter;
button.image = [UIImage imageNamed:@"Icon0"];
button.imageColor = [UIColor groupTableViewBackgroundColor];
button.backgroundColor = [UIColor darkGrayColor];
button.outlineColor = [UIColor darkGrayColor];
button.outlineWidth = 0.0f;
button.imagePadding = 20.0f;
button.horizontalOffset = 20.0f;
button.verticalOffset = -30.0f;
button.rounded = YES;
button.hideWhenScrollToTop = YES;

将对象设置为您의 UIScrollView/UITableView/UICollectionView。

[self.tableView setFloatingButtonView:button];

设置委托。

[self.tableView setFloatingButtonDelegate:self]

示例项目

更多详细信息请查看 示例 项目。一切都在那里。

变更日志

查看 Changelog.md

作者

Manuel Escrig Ventura, @manuelescrig

致谢

图标由Elegant Themes在www.flaticon.com制作

许可证

MEVFloatingButton遵循MIT许可证。有关更多信息,请参阅LICENSE文件。