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;