ios - 自定义 UIPopoverController View 背景和边框颜色

标签 ios ipad popover

是否可以更改弹出 View 的边框颜色、导航栏样式/颜色和箭头样式/颜色?如果是这样,如何?如果有一些示例代码可用,那就太好了!

最佳答案

从 iOS 7 开始,您可以更改 UIPopoverControllerbackgroundColor,这会影响导航背景颜色以及弹出框的箭头。

@property (nonatomic, copy) UIColor *backgroundColor NS_AVAILABLE_IOS(7_0);

使用示例:

    if ([self.popoverVC respondsToSelector:@selector(setBackgroundColor:)]) {   // Check to avoid app crash prior to iOS 7
        self.popoverVC.backgroundColor = [UIColor greenColor];
    }

注意 - 截至目前 (iOS 7.0.3),在某些情况下(例如使用 colorWithPatternImage: 设置颜色),模拟器不支持颜色但在设备上它可以工作很好

关于ios - 自定义 UIPopoverController View 背景和边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5974439/

相关文章:

ios - 模拟器中的 libsqlite 和 iOS 编译

ios - 在 Safari 浏览器上使用 ios 9.1 添加到主屏幕图标未在 Ipad 上填充

objective-c - 以编程方式显示 MPMoviePlayerController 中的控件

iphone - iOS UIScrollView - 检测分页滑动 - 中间图标大其他图标小

java - Swing :带箭头的弹出框

ios - Storyboard - 弹出框的委托(delegate)

ios - 无法推送,因为 self.navigationController 为 nil

ios - 在 JWPlayer For iOS 上双击禁用全屏

ios - 企业iOS : will adding an existing bundle ID to an app group invalidate already deployed apps?

iOS 应用组问题