Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.17 KB

objc.md

File metadata and controls

51 lines (35 loc) · 1.17 KB

ZKSegment

license build CocoaPods platform

安装

CocoaPods

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

platform :ios, '8.0'

target 'MyApp' do
    pod 'ZKSegment', '1.0.3'
end

快速使用

#import "ZKSegment.h"`
_ZKSegment = [ZKSegment
    zk_segmentWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 45)
                  style:ZKSegmentLineStyle];
_ZKSegment.zk_itemClickBlock=^(NSString *itemName , NSInteger itemIndex){
    NSLog(@"click item:%@",itemName);
    NSLog(@"click itemIndex:%d",itemIndex);
};
[_ZKSegment zk_setItems:@[ @"菜单1", @"菜单2" ]];

[self.view addSubview:_ZKSegment];

自定义

###属性

zk_itemDefaultColor 设置每一项文本默认颜色

zk_itemSelectedColor 设置每一项文本选中颜色

zk_itemStyleSelectedColor 选中项样式颜色

zk_backgroundColor 背景色