我有一个带取消按钮的搜索栏.但是,当我单击"取消"按钮时,它不会关闭搜索栏.如何点击取消它会将搜索栏返回到第一个状态?
如果您有任何问题 - 请问我
我添加了以下代码行:
var radius: CGFloat = UIScreen.mainScreen().bounds.width - 60
let path: UIBezierPath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width, height: UIScreen.mainScreen().bounds.height), cornerRadius: 0)
let circlePath: UIBezierPath = UIBezierPath(roundedRect: CGRect(x: 30, y: (UIScreen.mainScreen().bounds.height - radius) / 2 - (navigationController?.navigationBar.frame.height)!, width: radius, height: radius), cornerRadius: radius)
path.appendPath(circlePath)
Run Code Online (Sandbox Code Playgroud)
但它给了我这个结果
如何制作圆圈背景颜色 - clearColor()?
我试过这个:
UIColor.whiteColor().setFill()
circlePath.fill()
Run Code Online (Sandbox Code Playgroud)
但它没有任何意义
我刚看到这个图像,对我来说很有趣,如何在Swift中创建这种类型的动画:
所以,我有很多灰色的圆圈,当我设置角度时,例如45度,它会将这些灰色的牙齿填充到0..45度内的蓝色.
您可以向我解释正确的方法,或者您可以显示不同的片段(这会很棒).后来我会搜索或阅读它.
提前致谢!