Ios 使用表单模式演示文稿时设置着色颜色在iPad上不起作用
我在模态UIViewController中有一个UISearchBar,它的presentationStyle设置为UIModalPresentationStyleFormSheet 在搜索栏上设置色调颜色仅在iphone上适用。iPad最终还是使用了应用程序“淡色”。为什么会这样Ios 使用表单模式演示文稿时设置着色颜色在iPad上不起作用,ios,objective-c,ipad,Ios,Objective C,Ipad,我在模态UIViewController中有一个UISearchBar,它的presentationStyle设置为UIModalPresentationStyleFormSheet 在搜索栏上设置色调颜色仅在iphone上适用。iPad最终还是使用了应用程序“淡色”。为什么会这样 _searchBar = [[UISearchBar alloc] init]; _searchBar.tintColor = [UIColor whiteColor]; 为什么不在applicationl
_searchBar = [[UISearchBar alloc] init];
_searchBar.tintColor = [UIColor whiteColor];
为什么不在applicationlaunch中尝试搜索栏的外观
[[UISearchBar appearance] setTintColor:[UIColor whiteColor]];
那对我不起作用。工作原理是设置UITextField的外观,但这只是iOS7。您还可以在条形图的子视图上循环并更改UITextField的颜色:
[[UITextField appearance] setTintColor:[UIColor blackColor]];
为什么不在applicationlaunch中尝试搜索栏的外观。例如:-[[UISearchBar外观]setTintColor:[UIColor whiteColor]];那正是我最后要做的!谢谢@pawan