Latest 2.1.2
Homepage https://github.com/WangWenzhuang/ZKSegment
License MIT
Platforms ios 8.0, requires ARC
Authors

(logo)

license
build
CocoaPods
platform

ZKSegment 一个分段选择控件

1

如果您是Objective-C项目,请使用1.0.3版本,请点击

运行环境

  • iOS 8.0 +
  • Swift 3.0 +

安装

CocoaPods

你可以使用 CocoaPods 安装 ZKSegment,在你的 Podfile 中添加:

platform :ios, '8.0'
use_frameworks!

target 'MyApp' do
    pod 'ZKSegment'
end

手动安装

拖动 ZKSegment 文件夹到您的项目

快速使用

导入 ZKSegment

import ZKSegment

初始化函数

  • segmentLine 线形样式
  • segmentRectangle 矩形样式
  • segmentText 纯文本样式
  • segmentDot 点样式

举个例子

let segment = ZKSegment.segmentLine(
    frame: CGRect(x: 0, y: 50, width: self.view.frame.size.width, height: 45),
    itemColor: UIColor(red: 102.0 / 255.0, green: 102.0 / 255.0, blue: 102.0 / 255.0, alpha: 1),
    itemSelectedColor: UIColor(red: 202.0 / 255.0, green: 51.0 / 255.0, blue: 54.0 / 255.0, alpha: 1),
    itemFont: UIFont.systemFont(ofSize: 14),
    itemMargin: 20,
    items: ["菜单一", "菜单二", "菜单三", "菜单四", "菜单五", "菜单六", "菜单七", "菜单八"],
    change: { (index, item) in
        print("segmentLine change index:(index)")
    })
segment.backgroundColor = UIColor(red: 238.0 / 255.0, green: 238.0 / 255.0, blue: 238.0 / 255.0, alpha: 1)

Latest podspec

{
    "name": "ZKSegment",
    "version": "2.1.2",
    "platforms": {
        "ios": "8.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "u4e00u4e2au5206u6bb5u9009u62e9u63a7u4ef6u3002",
    "homepage": "https://github.com/WangWenzhuang/ZKSegment",
    "authors": {
        "WangWenzhuang": "[email protected]"
    },
    "source": {
        "git": "https://github.com/WangWenzhuang/ZKSegment.git",
        "tag": "2.1.2"
    },
    "source_files": "ZKSegment/*.swift",
    "requires_arc": true,
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    }
}

Pin It on Pinterest

Share This