当前位置:网站首页>Swift control encapsulation - paging controller
Swift control encapsulation - paging controller
2022-07-01 09:27:00 【Strive to repair the blessings】
The code is based on swift5.0
Code warehouse :https://github.com/CDLOG/swift5_CLJPageview
preview 
Encapsulated simple paging controller , Simple and easy to use
Initialization code
/ title view Related initialization
let titles = [" game "," entertainment "," live broadcast "," Scenery scenery "," Games games games "," entertainment "," live broadcast "," scenery "]
//titleview To configure
let titleStyle = CLJPageView_title_style()
titleStyle.titleHeight = 45
// Scrolling
titleStyle.isShowScrollLine = true
// Content controller related initialization
var childs = [UIViewController]()
for _ in titles {
let vc = UIViewController()
// Controller background color
vc.view.backgroundColor = UIColor.randomColor()
// Change to the controller you need
childs.append(vc)
}
// Paging control initialization
let frame = CGRect(x: 0, y: 64, width: view.bounds.width, height: view.bounds.height - 64)
let pageView = CLJPageView(frame: frame, titles: titles, childsVC: childs, parentVc: self, titleStyle: titleStyle)
view.addSubview(pageView)
The configurable properties of the top scroll bar are as follows
/// Scrollable or not
var isScrollEnable:Bool = true
/// Height
var titleHeight = 44
/// Common color
var normalColor:UIColor = UIColor(r: 0, g: 0, b: 0)
/// Choose a color
var selectColor:UIColor = UIColor(r: 255, g: 127, b: 0)
/// Normal font size
var normalFont:CGFloat = 15.0
/// Select font size
var selectFont:CGFloat = 18.0
/// Spacing when scrolling
var itemMargin:CGFloat = 30
/// Is there a scroll bar
var isShowScrollLine:Bool = false
/// Scroll bar height
var scrollLineHeight:CGFloat = 2
/// Scroll bar color
var scrollLineColor:UIColor = .orange
边栏推荐
- js valueOf 与 toString 区别
- 计网01-物理层
- 【ESP 保姆级教程】疯狂毕设篇 —— 案例:基于阿里云、小程序、Arduino的WS2812灯控系统
- Phishing identification app
- js原型陷阱
- Class loading
- ES6 decoupling top-level objects from windows
- Wechat applet WebView prohibits page scrolling without affecting the implementation of overflow scrolling in the business
- ES6 const essence and completely immutable implementation (object.free)
- Reproduced Xray - cve-2017-7921 (unauthorized access by Hikvision)
猜你喜欢

3D printing Arduino four axis aircraft

I use flask to write the website "one"

MapReduce编程基础

【pytorch】softmax函数

Principle and application of single chip microcomputer timer, serial communication and interrupt system

Principles of Microcomputer - Introduction
![[video game training] real topic of 2013 video game of infrared optical communication device](/img/ef/c2c45c1c6c24aed0a4e93101047372.png)
[video game training] real topic of 2013 video game of infrared optical communication device

Reproduced Xray - cve-2017-7921 (unauthorized access by Hikvision)
![Problems caused by delete and delete[]](/img/d9/a1c3e5ce51ef1be366a973aa42d1f0.png)
Problems caused by delete and delete[]

Football and basketball game score live broadcast platform source code /app development and construction project
随机推荐
Phishing identification app
R language observation log (part24) -- initialization settings
js原型继承仅可继承实例而非构造器
Latex插入的eps图片模糊解决方法
Exception handling of classes in C #
How to launch circle of friends marketing and wechat group activities
SDN_ Simple summary
美团2022年机试
[ESP nanny level tutorial preview] crazy node JS server - Case: esp8266 + MQ Series + nodejs local service + MySQL storage
Rich text interpolation
【ESP 保姆级教程 预告】疯狂Node.js服务器篇 ——案例:ESP8266 + MQ系列 + NodeJs本地服务 + MySql存储
Redis -- lattice connects to redis cluster
Dspic30f6014a LCD block display
2.3 【kaggle数据集 - dog breed 举例】数据预处理、重写Dataset、DataLoader读取数据
Win7 pyinstaller reports an error DLL load failed while importing after packaging exe_ Socket: parameter error
nacos服务配置和持久化配置
2.2 【pytorch】torchvision. transforms
JS prototype trap
【ESP 保姆级教程】疯狂毕设篇 —— 案例:基于物联网的GY906红外测温门禁刷卡系统
树结构---二叉树1