美文网首页
工作记 Swift3.0 -> UISearchBar 去

工作记 Swift3.0 -> UISearchBar 去

作者: 指尖猿 | 来源:发表于2017-06-01 19:54 被阅读32次

自己写 UISearchBar 发现有一个阴影如下

感谢stackoverflow

链接如下stackoverflow 地址

let searchView = UISearchBar.init(frame: CGRect.init(x: 8, y: 26, width: ScreenWidth - 16 - 44, height: 30))

navigationView.addSubview(searchView)

for subView in searchView.subviews {

for view in subView.subviews {

if view.isKind(of:NSClassFromString("UISearchBarBackground")!) {

let imageView = view as! UIImageView

imageView.removeFromSuperview()

}

}

}

最后解决如下

相关文章

网友评论

      本文标题:工作记 Swift3.0 -> UISearchBar 去

      本文链接:https://www.haomeiwen.com/subject/txoefxtx.html