在uisearchbar和范围栏上使用时,范围栏的色彩在iOS 4.3中没有更新。在其余的iOS版本中,它的工作正常。
最佳答案
for (id subview in yourSearchDisplayController.searchBar.subviews )
{
if([subview isMemberOfClass:[UISegmentedControl class]])
{
UISegmentedControl *scopeBar=(UISegmentedControl *) subview;
[scopeBar setSegmentedControlStyle:UISegmentedControlStyleBar];
[scopeBar setTintColor: [UIColor redColor]];//you can also set RGB color here
//scopeBar.tintColor = [UIColor blackColor];
}
}
另请参阅此链接中的我的答案以修改
UISearchBar
组件How to change inside background color of UISearchBar component on iOS
关于iphone - UISearchBar范围栏色调颜色问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14121071/