Skip to content

clarkIsMe/CYRuler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CYRuler

标尺升级版 (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  

About

scrollRulerView upgrade

Resources

License

Stars

Watchers

Forks

Packages

No packages published