16年一月份写的时钟小Demo,今天徒弟问我要,运行了下发现崩了:
API不支持了,所以:
[self.view.layer addSublayer:_timeImageView.layer];
改成了
[self.view addSubview:_timeImageView];
如果有像博主一样曾这么干的,就动手改改吧。
本文介绍了一个16年编写的iOS时钟Demo遇到的问题及解决方案。由于API不再支持,原代码使用[self.view.layer addSublayer:_timeImageView.layer]添加图层的方式已失效。博主将此行代码替换为[self.view addSubview:_timeImageView],成功解决了问题。
16年一月份写的时钟小Demo,今天徒弟问我要,运行了下发现崩了:
API不支持了,所以:
[self.view.layer addSublayer:_timeImageView.layer];
改成了
[self.view addSubview:_timeImageView];
如果有像博主一样曾这么干的,就动手改改吧。
1017

被折叠的 条评论
为什么被折叠?