Giter Site home page Giter Site logo

rainmango / aypagecontrol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ayjk/aypagecontrol

0.0 3.0 0.0 69 KB

PageControl With Drop Animation / 带动效的页数控制

Home Page: http://ayjkdev.top/

License: MIT License

Ruby 2.44% Objective-C 97.56%

aypagecontrol's Introduction

AYPageControl

LICENSE  CocoaPods Version SUPPORT  BLOG 

一个有动效的PageControl,效果图如下:

效果图

##我的blog中有相关的内容讲解 一个水滴动效的pageController(一)

##如何使用 ###1.导入头文件

#import "AYPageControl.h"

###2.为pageControl设置总页数并绑定scrollview

//	设置总页数
self.pageControlView.numberOfPages = totalPages;
//	绑定对应的scrollview
self.pageControlView.bindingScrollView = self.bannerScrollView;
//  设置形变小球的颜色
self.pageControlView.selectedColor = [UIColor blackColor];
//  设置背景小球的颜色
self.pageControlView.unSelectedColor = [UIColor lightGrayColor];

###3.在代理方法中设置pageControl的属性

//	将scrollview的contentOffset.x赋值给pageControl进行计算
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

    self.pageControlView.contentOffset_x = scrollView.contentOffset.x;
}
//  scrollview滑动玩后将最终的contentOffset传递过去
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
    
    self.pageControlView.lastContentOffset_x = scrollView.contentOffset.x;
}
//  scrollview滑动玩后将最终的contentOffset传递过去(暂时未用到,后期添加功能使用)
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
    
    self.pageControlView.lastContentOffset_x = scrollView.contentOffset.x;
}

##安装 AYPageControl支持CocoaPods,在Podfile中输入

pod 'AYPageControl'

##更新内容 ###v0.0.2

  • 优化了滑动视图时,小球的形变动画。

###v0.0.1

  • 首次提交:实现动画

##License This project is under MIT License. See LICENSE file for more information.

aypagecontrol's People

Contributors

ayjk avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.