GithubHelp home page GithubHelp logo

mrsool / glviewpagercontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuyanci/glviewpagercontroller

0.0 0.0 0.0 2 MB

GLViewPagerViewController is an common public control, it is usally used in news, here use UIPageViewController and UIScrollView as tab container to build it.

License: MIT License

Objective-C 96.38% Ruby 3.62%

glviewpagercontroller's Introduction

GLViewPagerController

Build Status converage license

GLViewPagerViewController属于公用控件,常见于新闻资讯模块,这里主要用UIPageViewController以及UIScrollView作为标签栏容器视图来构建。

GLViewPagerViewController is an common public control, it is usally used in news, here use UIPageViewController and UIScrollView as tab container to build it.

GLViewPagerViewController for swift is available refer link

Here is an project where i use it . Project:666

Example (例子)

运行工程例子,克隆仓库和构建工程,例子支持Objective-C。

To run the example project, clone the repo and build the project. Examples are available for Objective-C project.

Installation (安装)

GLViewPagerController 支持cocoapods,你可以这样来使用它

GLViewPagerController is now available support cocoapods now, you can use it

pod 'GLViewPagerViewController', '~> 1.0.1'

Usage

使用标签分页控件,你需要创建一个UIViewController作为GLViewPagerViewController的子类,然后实现下面的数据源接口:

To use the tabbed page view controller, simply create a UIViewController that is a subclass of GLViewPagerViewController. Then implement the following data source method:

Here return the amount of the tabs 
- (NSUInteger)numberOfTabsForViewPager:(GLViewPagerViewController *)viewPager;

Here return the view of the tab at index
- (UIView *)viewPager:(GLViewPagerViewController *)viewPager
      viewForTabIndex:(NSUInteger)index;

Here return the contentview of the viewpager at index
- (UIViewController *)viewPager:(GLViewPagerViewController *)viewPager
contentViewControllerForTabAtIndex:(NSUInteger)index;

Page View Controller Enhancements

Here you can get the tab index when swithing between tabs.
- (void)viewPager:(GLViewPagerViewController *)viewPager didChangeTabToIndex:(NSUInteger)index fromTabIndex:(NSUInteger)fromTabIndex;

Want to animate font or textcolor when switching tabs, you can use this delegate method, the progress value range from 0.0 to 1.0.
- (void)viewPager:(GLViewPagerViewController *)viewPager willChangeTabToIndex:(NSUInteger)index fromTabIndex:(NSUInteger)fromTabIndex withTransitionProgress:(CGFloat)progress;

Here you can return the tab width at index, if not implement this interface, it use the default tabwidth value.
- (CGFloat)viewPager:(GLViewPagerViewController *)viewPager widthForTabIndex:(NSUInteger)index;

Appearance

-indicatorColor - The indicator color

-fixTabWidth - When fixtabWidth is true, it use tabWidth as default value, if fixtabWidth is false, it will adjust its width for its content size.

-tabWidth - The default tabWidth value when fixtabWidth is true.

-tabHeight - The default tabHeight

-indicatorHeight - The indicator height

-indicatorWidth - The indicator width when fixIndicatorWidth is true

-fixIndicatorWidth - When fixIndicatorWidth is true, it use indicatorWidth as default value, if fixIndicatorWidth is false, it will adjust its width for tab content size.

-padding - The padding between tabs

-leadingPadding - The leadingPadding for the first tab

-trailingPadding - The trailingPadding for the last tab

-defaultDisplayPageIndex - The default display page index when first display

-animationTabDuration - The tab animation duration

-tabAnimationType - The tabAnimation type,list belows:

-GLTabAnimationType_none - it means no animation

-GLTabAnimationType_whileScrolling - animate while scrolling tab

-GLTabAnimationType_end - animation when finish scrolling tab

-supportArabic - When supportArabic is true, layout will be reverse, default is false

Requirements

Supports iOS 8 and above.

Author

Xu Yanci

Mail: XuYanci

glviewpagercontroller's People

Contributors

xuyanci avatar kishanraiyani03 avatar taglia3 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.