ScrollPage 1.0.3

ScrollPage 1.0.3

测试已测试
Lang语言 SwiftSwift
许可协议 MIT
发布最新发布2017年8月
SwiftSwift 版本3.0
SPM支持 SPM

TeCheng Hung 维护。



ScrollPage

ScrollPage 是一种自定义控件,它是包含容器视图和可滚动的标签栏的 UIScrollView 的混合体。

示例

(未定制)

demo demo

安装

CocoaPods

ScrollPage 通过 CocoaPods 提供。!! 仅 Swift !!

要安装,请在 Podfile 中添加以下行

pod 'ScrollPage'

如何使用

//Add the title bar elements as an Array of String
swipeableView.titleBarDataSource = titleBarDataSource //Array of Button Titles like ["Movies", "Society", "Health"]

//Assign your viewcontroller as delegate to load the Viewcontroller
swipeableView.delegate = self

//Set the View Frame (64.0 is 44.0(NavigationBar Height) + 20.0(StatusBar Height))
swipeableView.viewFrame = CGRect(x: 0.0, y: 64.0, width: UIScreen.mainScreen().bounds.width, height: UIScreen.mainScreen().bounds.height-64.0)

//Then add the view controller on the current view.
self.addChildViewController(swipeableView)
self.view.addSubview(swipeableView.view)
swipeableView.didMoveToParentViewController(self)

定制

swipeableView.buttonWidth = 60.0

同样,可以使用以下方式更改选择栏的高度

swipeableView.selectionBarHeight = 2.0 //For thin line

我们也可以使用以下代码更改 segmentBar 的高度

swipeableView.segementBarHeight = 50.0 //Default is 44.0

按钮中的填充可以使用以下方式自定义

swipeableView.buttonPadding = 10.0 //Default is 8.0