Giter Club home page Giter Club logo

aspageviewcontroller-oc's Introduction

ASPageViewController-OC

封装了一个OC版本的ASPageViewController用来实现手势滑动翻页和点击滑动翻页的功能

什么是ASPageViewController

我们在日常的app中经常会用到实现手势滑动翻页和点击翻页来实现对试图控制器控制的功能,趁着最近不忙,封装了一个实现这种功能的库分享给大家,希望大家能够喜欢,同时也希望大家能够提出宝贵的意见,谢谢!

支持pod导入

pod 'ASPageViewController', '~> 0.0.1'

github链接:https://github.com/zhanghongdou/ASPageViewController.git

随后为大家分享swift3.0封装的此库,希望大家能够多提宝贵的意见,谢谢

ASPageViewController和WMPageController的比较

WMPageController使用的是UIScrollView实现的这个功能,避免不了的,造成代码过多,本小编封装的ASPageViewController是借助UIPageViewController实现的,代码估计只有前者的三分之一吧,这也是本小编感觉比较荣幸的,但是还是很佩服WMPageController的作者的封装,本小编也在其中学到了不少的知识点,在这里也感谢WMPageController的作者,还有一点就是WMPageController可以实现添加作为导航栏的titleView,本小编封装的ASPageViewController暂为实现这个点,本小编在后续工程中会不断完善,谢谢大家的支持,下面给大家献上具体的接口和gif效果图

效果图1(带有下划线的样式)

效果图2(无下划线的样式)

调用接口

//实例化 ASPageViewController *vc = [[ASPageViewController alloc]initWithViewControllerClasses:@[[A1ViewController class], [A2ViewController class], [A3ViewController class], [A4ViewController class], [A5ViewController class]] andTitles:@[@"控制1",@"控制2",@"控制3",@"控制4",@"控制5"]];
//设置每一个item的宽度
vc.itemWidth = 90;
//设置样式(有下划线)
vc.style = ASTopViewStyleLine;
//(无下划线)
// vc.style = ASTopViewStyleNOLine;
//设置两边空出的宽度
// vc.sideBothWidth = 20;
//设置正常的字体颜色
// vc.normalTitleColor = [UIColor orangeColor];
//设置选中的时候的字体颜色
// vc.selectTitleColor = [UIColor blueColor];
//设置上部item的背景色
// vc.topViewBackGroundColor = [UIColor yellowColor];
//设置下划线的颜色
// vc.lineColor = [UIColor blueColor];
//设置所有item的宽度数组
// vc.itemWidthArray = @[@(150),@(80),@(70),@(90),@(150)];


aspageviewcontroller-oc's People

Contributors

zhanghongdou avatar

Watchers

 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.