我的导航栏看起来像下面附带的图像。如何删除黑色边框?
我生成的代码如下:
var searchBar : UISearchBar = UISearchBar(frame: CGRectMake(-5, 0, 320, 44))
searchBar.autoresizingMask = UIViewAutoresizing.FlexibleWidth
searchBar.layer.borderWidth = 1
searchBar.searchBarStyle = UISearchBarStyle.Minimal
var searchBarView : UIView = UIView(frame: CGRectMake(0, 0, 310, 44))
searchBarView.autoresizingMask = nil
searchBarView.layer.borderWidth = 0;
searchBarView.layer.borderColor = UIColor.clearColor().CGColor
searchBar.delegate = self;
searchBarView.addSubview(searchBar)
答案 0 :(得分:1)
也许你也在视图上做了什么,
searchBar.layer.borderColor = UIColor.clearColor().CGColor