C360PopoverBackgroundView 1.0.2

C360PopoverBackgroundView 1.0.2

测试已测试
语言语言 Objective-CObjective C
许可证 MIT
发布最后一次发布2014年12月

Aithusa 维护。



  • 作者:
  • Simon Booth

C360PopoverBackgroundView 是一个可RGBA着色的 UIPopoverBackgroundView 子类,模仿系统弹出视图的外观。

要在项目中使用 C360PopoverBackgroundView,将其添加到 podfile 中

pod 'C360PopoverBackgroundView', '~> 1.0.0'

然后运行

$ pod install

有关 pods 和 podfiles 的更多信息,请访问CocoaPods 网站。

C360PopoverBackgroundView 安装后,您可以在创建 UIPopoverController 时设置 popoverBackgroundViewClass 属性来使用它

#import "C360PopoverBackgroundView.h"

- (void)myExampleMethod
{   
    UIViewController *contentController [[UIViewController alloc] init];
    UIPopoverController *popoverController = [[UIPopoverController alloc] initWithContentViewController:contentController];
    popoverController.popoverBackgroundViewClass = [C360PopoverBackgroundView class];

    ...

要更改颜色,请使用类的外观代理

#import "C360PopoverBackgroundView.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [[C360PopoverBackgroundView appearance] setTintColor:[UIColor greenColor]];

    ...

或者可以使用 UISS

{
    "C360PopoverBackgroundView" : {
        "tintColor" : "green"
    },

    ...

您可以使用相同的方式更改边框颜色或光泽颜色

    [[C360PopoverBackgroundView appearance] setBorderColor:[UIColor grayColor]];
    [[C360PopoverBackgroundView appearance] setGlowColor:[UIColor colorWithRed:0.5 green:0.0 blue:0.0 alpha:0.2]];