GithubHelp home page GithubHelp logo

ccnestscrollview's Introduction

CCNestScrollView

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

CCUnreadManager is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'CCNestScrollView'

How to use

  • UIScrollView嵌套中在角色有 子UIScrollView 嵌套在父UIScrollView中
/// 嵌套方案中的角色
typedef NS_ENUM(NSUInteger, CCNestScrollRole) {
    CCNestScrollRoleNone,    //
    CCNestScrollRoleChild,   //子scrollview
    CCNestScrollRoleFather,  //父scrollview
};
  • 父UIScrollView设置
    self.fatherscrollView.hookGestureDelegate = YES; //开启手势代理劫持
    self.fatherscrollView.shouldRecognizeSimultaneously = YES; //开启多手势识别
    self.fatherscrollView.role = CCNestScrollRoleFather;//设置角色
    self.fatherscrollView.canScroll = YES;  //默认要开启
    self.fatherscrollView.criticalOffset =  160; //父scrollview为切换到子scrollview滚动的偏移值
  • 子UIScrollView设置
    self.childScrollView.role = CCNestScrollRoleChild;  //设置角色
    self.childScrollView.superSrcollView = self.fatherscrollView;//设置父UIScrollView
    self.childScrollView.criticalOffset = 0;// 子scrollview 为切换到父scrollview滚动的偏移值
    self.fatherscrollView.childScrollView = self.childScrollView; //赋值给父UIScrollView作为子scrollview
  • 如果有多个父UIScrollView有多个嵌套多个UIScrollView 需要动态设置 childScrollView 属性,轮到哪个子UIScrollView显示的时候就设为哪个。 详情参考Example

Author

lucc, [email protected]

ccnestscrollview's People

Contributors

lucycue 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.