Git Product home page Git Product logo

jxpagecontrol's Introduction

JXPageControl

CI Status Version License Platform

(JXPageControl supports multiple animation transformations, content layout transformations, and Xib layouts )

 

(If there is any problem, you can leave a message, welcome to study together, welcome star )


Installation

To install, simply add the following code to your Podfile :

platform :ios, '8.0'

target 'TargetName' do
    pod 'JXPageControl'
end

The UI effect

JXPageControlChameleon JXPageControlExchange JXPageControlFill

 

JXPageControlJump JXPageControlScale

Frame set

  • Common Framework common class files
  • Jump - Jump animation effects class file
  • Transform - Transition animation class file


JXPageControl introduction [ JXPageControl 介绍 ]

JXPageControl ADAPTS to Swift and objective-c

 

  • JXPageControlBase - Base class for all pageControl
  • JXPageControlType - All pageControl protocols, it provides a number of custom apis for developers to use

 

JXPageControlType - provides - API

 

  • numberOfPages ---> Number of indicators.
  • currentPage ---> Current indicator page number.
  • progress ---> Current indicator page numbering process.
  • hidesForSinglePage ---> Whether to hide when there is only one indicator.
  • inactiveColor ---> Inactive indicator color
  • activeColor ---> Active indicator color
  • inactiveSize ---> Inactive indicator size
  • activeSize ---> Active indicator size
  • indicatorSize ---> All indicator sizes
  • columnSpacing ---> Horizontal distance between indicators
  • contentAlignment ---> Content layout location (note that this property is easy to use!!!!! )
  • contentMode ---> Content layout location, and support for transformation in Xib, real-time view of location changes (note that this property is very useful!!!!! )
  • isInactiveHollow ---> Whether the inactive indicator is a hollow pattern
  • isActiveHollow ---> Whether the active indicator is a hollow pattern
  • reload() ---> Refresh data/UI
Be careful :

JXPageControl also provides some APIs for non-JXPageControlType. You can view it in the specific classes you use

 


JXPageControl uses :

 

Example 1

  • Use (xib, storyboard for properties and layout Settings!!! )
  • Note that the module should select JXPageControl, otherwise it will not show up and the call will report an error.
  • ContentMode can be set in View to change content location

 


Example 2

  • Write it in pure code

import JXPageControl

class ChamelonVC: UIViewController {

lazy var codePageControl: JXPageControlJump = {
let pageControl = JXPageControlJump(frame: CGRect(x: 0,
y: 0,
width: UIScreen.main.bounds.width,
height: 30))
pageControl.numberOfPages = 4

// JXPageControlType: default property
//        pageControl.currentPage = 0
//        pageControl.progress = 0.0
//        pageControl.hidesForSinglePage = false
//        pageControl.inactiveColor = UIColor.white.withAlphaComponent(0.5)
//        pageControl.activeColor = UIColor.white
//        pageControl.inactiveSize = CGSize(width: 10, height: 10)
//        pageControl.activeSize = CGSize(width: 10, height: 10)
//        pageControl.inactiveSize = CGSize(width: 10, height: 10)
//        pageControl.columnSpacing = 10
//        pageControl.contentAlignment = JXPageControlAlignment(.center,
//                                                              .center)
//        pageControl.contentMode = .center
//        pageControl.isInactiveHollow = false
//        pageControl.isActiveHollow = false

// JXPageControlJump: default "custom property"
pageControl.isAnimation  = true
pageControl.isFlexible = true

return pageControl
}()

override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(codePageControl)
}

}

extension ChamelonVC: UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let progress = scrollView.contentOffset.x / scrollView.bounds.width
let currentPage = Int(round(progress))

//  Mode one 
codePageControl.progress = progress

// Mode two 
//        codePageControl.currentPagev = currentPage

}

}



Example 2 and so on ...


import JXPageControl
...

Author

Code-TanJX, [email protected]

License

JXPageControl is available under the MIT license. See the LICENSE file for more info.

jxpagecontrol's People

Contributors

coder-tanjx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jxpagecontrol's Issues

添加JXPageControlExchange导致vc push动画失效

大佬 你好!
目前使用此框架发现,在vc里加入JXPageControlExchange时,外面push到此vc时,push动画会失效
不知道是不是只有我遇到此问题。
lazy var pageControl: JXPageControlExchange = {
let view = JXPageControlExchange.init(frame: CGRect.zero)
view.numberOfPages = 1
view.currentPage = 0
return view
}()

self.view.addSubView(pageControl)

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.