Monotouch.Dialog – UISearchBar Tint

当在DialogViewController上启用search栏时,search栏的色调如何改变?

  EnableSearch = true; SearchPlaceholder = "Find station"; AutoHideSearch = false; 

MonoTouch.Dialog中的search栏是私有的,当searchBar被实例​​化时,需要修改源代码来更改TintColor。

评论中提出的另一个select是使用:

 ((UISearchBar) TableView.TableHeaderView).TintColor = UIColor.Black; 

以Miguel的帮助,我发现TableHeaderView容器的SearchBar所以我可以做这个改变searchBar实例化(谢谢)后的tint

 UISearchBar sb = TableView.TableHeaderView as UISearchBar; if(sb!=null) sb.TintColor = UIColor.Black;