Popover箭头与viewcontroller背景颜色不同

use*_*600 23 xcode objective-c storyboard popover

标题说明了一切.我有一个视图控制器连接到按钮作为弹出窗口.视图控制器的背景颜色为灰色,但指向按钮的箭头颜色为白色.任何帮助将非常感激.

mah*_*udz 41

这是我如何解决它:

popover = [[UIPopoverController alloc] initWithContentViewController:contentViewController];
popover.backgroundColor = contentViewController.view.backgroundColor;
Run Code Online (Sandbox Code Playgroud)

这将弹出窗口与内容背景的颜色相匹配.


NSG*_*ode 19

for ios 9.0 +(cpvc是你的ViewController)

cpvc.popoverPresentationController.backgroundColor = cpvc.view.backgroundColor;
Run Code Online (Sandbox Code Playgroud)


小智 5

你在使用IOS7 sdk吗?

也许你可以尝试:

[popover setBackgroundColor:[UIColor whiteColor]];
Run Code Online (Sandbox Code Playgroud)

并确保将内容视图控制器的背景颜色设置为白色.