UIPopoverController,如何设置popover的背景?

发布于 2024-12-02 00:57:04 字数 214 浏览 4 评论 0原文

UIPopoverController,如何设置popover的背景?

[[[self.popoverController contentViewController]  view] setBackgroundColor:[UIColor blueColor]];

这不起作用(( 弹出窗口中的背景应该与 tableView(根)中的背景不同。

UIPopoverController, how to set background for popover?

[[[self.popoverController contentViewController]  view] setBackgroundColor:[UIColor blueColor]];

This doesn't work((
Background in popover should be different than in tableView (root).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落日海湾 2024-12-09 00:57:04

UIPopoverController 继承自 NSObject,它没有背景属性或自己的视图来自定义视图的背景。因此,在这种情况下,您只能操作 contentViewController 的视图。

你的代码对我来说工作得很好。现在桌面视图中的背景是蓝色的。

_popController = [[UIPopoverController alloc] initWithContentViewController:settingsPopoverController];
[[[_popController contentViewController]  view] setBackgroundColor:[UIColor blueColor]];

UIPopoverController is inherited from NSObject and it has no background property or own view for customizing view's background. So, in this case you can only manipulate the view of contentViewController.

And your code works fine for me. Background is blue in tableview now.

_popController = [[UIPopoverController alloc] initWithContentViewController:settingsPopoverController];
[[[_popController contentViewController]  view] setBackgroundColor:[UIColor blueColor]];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文