Latest 1.5
Homepage https://github.com/clarkIsMe/CYRuler
License MIT
Platforms ios 7.0, requires ARC
Authors

标尺升级版 (scrollRulerView upgrade)

image

create an ruler that horizontal and up

CYRuler *ruler = [CYRuler horizontalUpRulerWithFrame:CGRectMake(10, 300, 300, 80)];
[self.view addSubview:ruler];
ruler.rulerDelegate = self;
[ruler rulerWithPointerOffset:100.0f startScale:10 endScale:1000 valueOfUnitScale:10 defaultScale:20];
create an ruler that horizontal and down

CYRuler *ruler = [CYRuler horizontalDownRulerWithFrame:CGRectMake(10, 100, 300, 80)];
[self.view addSubview:ruler];
ruler.rulerDelegate = self;
[ruler rulerWithPointerOffset:100.0f startScale:10 endScale:1000 valueOfUnitScale:10 defaultScale:20];
custom attribute

ruler.scaleNumberFont = [UIFont systemFontOfSize:8];
ruler.scaleNumberColor = [UIColor whiteColor];
ruler.scaleLineColor = [UIColor whiteColor];
ruler.scaleLineWidth = 0.5;
reset the ruler

[ruler rulerResetPointerOffset:150 startScale:30 endScale:1000 valueOfUnitScale:10 defaultScale:50];
custom pointer

UIView *pointer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)];
pointer.backgroundColor = [UIColor whiteColor];
ruler.pointer = pointer;   //can not be nil
custom text display box

UILabel *scaleLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
scaleLable.backgroundColor = [UIColor blueColor];
scaleLable.textAlignment = NSTextAlignmentCenter;
ruler.scaleLable = scaleLable;  //can be nil

how to use


pod 'CYRuler'

#import 

Latest podspec

{
    "name": "CYRuler",
    "version": "1.5",
    "license": "MIT",
    "summary": "An custome scoller ruler.",
    "homepage": "https://github.com/clarkIsMe/CYRuler",
    "authors": {
        "u9a6cu6625u96e8": "[email protected]"
    },
    "source": {
        "git": "https://github.com/clarkIsMe/CYRuler.git",
        "tag": "1.5"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "CYRuler/CYRuler/**/*.{h,m}"
}

Pin It on Pinterest

Share This