Skip to content

可以灵活设定的自定义标尺( Custom scales can be set flexibly)。

Notifications You must be signed in to change notification settings

xuetongfei/scrollRuler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

scrollRuler

Image text

1、下载Demo到本地

2、把scrollRuler导入到工程中

在工程中的使用方法

//初始化
_ruler = [[TTScrollRulerView alloc] initWithFrame:CGRectMake(0,fit(465*2+22-90), ScreenW, fit(60+90))];
//设置代理
_ruler.rulerDelegate = self;
//设置最小值
_ruler.lockMin = 10;
//设置最大值
_ruler.lockMax = 360;
//设置默认值
_ruler.lockDefault = 30;
//开始绘制
[_ruler drawRuler];
//设置一根红线标识
[self.view addSubview:self.ruler];
//设置样式
[self.ruler selectedAction];

//添加中央红色刻度线
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(self.view.bounds.size.width/2-0.5,fit(465*2+12) , 0.5, fit(70))];
[self.view addSubview:line];
line.backgroundColor = UIColorFromRGB(0xFF8519);
#pragma mark 标尺代理方法
- (void)rulerWith:(NSInteger)days {
    //即时打印出标尺滑动位置的数值
    NSLog(@"当前刻度值:%ld",days);
}

About

可以灵活设定的自定义标尺( Custom scales can be set flexibly)。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published