CustomScrollIndicator 0.1.1

CustomScrollIndicator 0.1.1

测试测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2014年12月

Jérôme Morissard 维护。



  • Morissard Jérome

一个可自定义的 iOS 滚动指示器

  • 允许自定义 UIScrollView 滚动指示器,
  • 仅有一个类别

Image Image

枚举配置指示器位置

typedef enum {
  JMOVerticalScrollIndicatorPositionRight     = 1 << 0, //Default for vertical
  JMOVerticalScrollIndicatorPositionLeft      = 1 << 1,
  JMOHorizontalScrollIndicatorPositionBottom  = 1 << 2, //Default for horizontal
  JMOHorizontalScrollIndicatorPositionTop     = 1 << 3,
} JMOScrollIndicatorPosition;

枚举配置指示器类型

typedef enum {
    JMOScrollIndicatorTypeClassic = 0, //Default
    JMOScrollIndicatorTypePageControl
} JMOScrollIndicatorType;

用法 ... 非常简单,只需启用自定义(使用默认参数)

[scrollView enableCustomHorizontalScroll];

使用选项

 [scrollView4 enableCustomScrollIndicatorsWithScrollIndicatorType:JMOScrollIndicatorTypeClassic 
              positions:JMOHorizontalScrollIndicatorPositionTop 
              color:[UIColor orangeColor]];

刷新 ... 在您的 scrollViewDelegate 中调用方法(scrollViewDidScroll 是可选的,KVO 已完成工作)

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    [scrollView refreshCustomScrollIndicatorsWithAlpha];
}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    [UIView animateWithDuration:0.25 animations:^{
        [scrollView refreshCustomScrollIndicatorsWithAlpha:0.0];
    }];
}