小编Max*_*Sim的帖子

具有清晰背景的 UISlider 拇指图像显示其后面的轨道

如何设置清晰的拇指背景UISlider以使轨道在拇指后面不可见?

当我使用setThumbImage:forState:并传递部分透明图像时,滑块的最小轨道和最大轨道图像/颜色在拇指图像后面可见:

拇指后面可见轨迹

我希望它看起来像在 iOS 相机应用程序中,其中“透明”拇指图像圆圈剪辑轨道背景颜色:

iOS 相机滑块

objective-c uikit uislider ios

3
推荐指数
1
解决办法
2221
查看次数

动画CAShapeLayer

我用这段代码画了一个图:

CAShapeLayer *curentGraph = [CAShapeLayer new];
CGMutablePathRef linePath = CGPathCreateMutable();
curentGraph.lineWidth = 3.0f;
curentGraph.fillColor = [[UIColor clearColor] CGColor];
curentGraph.strokeColor = [colorGraph CGColor];
for (NSValue *value in arrOfPoints) {
    CGPoint pt = [value CGPointValue];
    CGPathAddLineToPoint(linePath, NULL, pt.x,pt.y);
};
curentGraph.path = linePath;CGPathRelease(linePath);
[self.layer addSublayer:curentGraph];
Run Code Online (Sandbox Code Playgroud)

它看起来像这样

图表截图

但我有一个问题.我需要为图形显示动画.每个点都应该从位置向上移动y = 0y = pt.y.就像他们在本网站的图表中所做的那样.

如何为我的图形设置动画?

iphone core-animation objective-c cashapelayer ios

2
推荐指数
2
解决办法
8338
查看次数