# 时间轴效果的实现

``````  CGFloat circularLabelWidth = 10;
UILabel *circularLabel = [[UILabel alloc] initWithFrame:CGRectMake(CELL_HEIGHT_FOOT_LEFTX/2 - circularLabelWidth/2, Height_Section_Header/2 - circularLabelWidth/2, circularLabelWidth, circularLabelWidth)];
circularLabel.backgroundColor = self.footPrintTableView.backgroundColor;
circularLabel.layer.borderColor = [UIColor whiteColor].CGColor;
circularLabel.layer.borderWidth = circularLabelWidth/4;

a123456678 2016-07-28 11:48:21 1906 0
1 条回答

• 构思一下
1个正方形方块＋1个圆环

开始
假设cell的背景色为#define CELLBGCOLOR [UIColor colorwith......]

//1.实现方块,定义方块的长=15 高＝15 构造一个透明假象

UIView *sqView = [[UIView alloc] initWithFrame:CGRectMake(CELL_HEIGHT_FOOT_LEFTX/2 - 15/2, Height_Section_Header/2 - 15/2, 15, 15)];
sqView.backgroundColor = CELLBGCOLOR;//这里就是为了让其和cell的背景一致啦

//2.添加你的圆环,如何剧中，自己处理下把

``````        CGFloat circularLabelWidth = 10;
UILabel *circularLabel = [[UILabel alloc] initWithFrame:CGRectMake(2.5, 2.5, circularLabelWidth, circularLabelWidth)];
circularLabel.backgroundColor = self.footPrintTableView.backgroundColor;
circularLabel.layer.borderColor = [UIColor whiteColor].CGColor;
circularLabel.layer.borderWidth = circularLabelWidth/4;``````

2019-07-17 20:01:18
赞同 展开评论 打赏

515
1
0
295
1
0
401
1
0
642
0
0
1301
1
0
2475
1
0
656
1
0
848
1
0
434
0
0
601
0
0