Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 使用表单模式演示文稿时设置着色颜色在iPad上不起作用_Ios_Objective C_Ipad - Fatal编程技术网

Ios 使用表单模式演示文稿时设置着色颜色在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

我在模态UIViewController中有一个UISearchBar,它的presentationStyle设置为UIModalPresentationStyleFormSheet

在搜索栏上设置色调颜色仅在iphone上适用。iPad最终还是使用了应用程序“淡色”。为什么会这样

  _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