1

当我在 a 上启用搜索栏时,搜索栏DialogViewController的色调是如何改变的?

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

2 回答 2

3

MonoTouch.Dialog 中的搜索栏是私有的,您需要修改源代码以在实例化 searchBar 时更改 TintColor。

评论中建议的另一个选项是使用:

((UISearchBar) TableView.TableHeaderView).TintColor = UIColor.Black;
于 2011-12-24T15:06:59.157 回答
0

在 Miguel 的帮助下,我发现了TableHeaderView容器,SearchBar所以我可以在实例化tint后更改容器(谢谢):searchBar

UISearchBar sb = TableView.TableHeaderView as UISearchBar;
if(sb!=null)
   sb.TintColor = UIColor.Black;
于 2012-01-01T20:25:14.133 回答