UIPopoverController 不是那么带颜色的

UIPopoverController is not so with a color

有谁知道为什么会出现白色部分?我的视图已经是灰色的,但是有两个白色的部分

whites:箭头和最后的 Popover!

[更新]

这是调用弹出窗口并使箭头指向被单击按钮的代码!

- (void) buttonFilter {

    if (viewFilter == @"Artistas") {
        content = [self.storyboard instantiateViewControllerWithIdentifier:@"TipoArtistaViewController"]; // MUDAR PARA O NOVO FILTRO DE ARTISTAS
    } else if (viewFilter == @"Músicas") {
        content = [self.storyboard instantiateViewControllerWithIdentifier:@"CategoriaViewController"];
    }

    [self callFilter:btnFilter Filter:content];
}

- (void)callFilter:(id)sender Filter:(UIViewController *) content{
    self.currentPop = popoverController;

    popoverController = [[WYPopoverController alloc] initWithContentViewController:content];

    UIButton * bt = (UIButton * )sender;
    UIView *view = [bt valueForKey:@"view"];
    popoverController.popoverContentSize = CGSizeMake(320, 180);
    popoverController.delegate = self;
    [popoverController presentPopoverFromRect:view.bounds inView:view permittedArrowDirections:WYPopoverArrowDirectionAny animated:YES];
 }

接下来是安装会话的位置:

//extend and collpase
- (void)setupViewController {

    categoriaBD = [categoriaDAO selectCategoria];


    self.data = [[NSMutableArray alloc] init];
    for (int i = 0; i < [categoriaBD count]; i++)
    {
        NSMutableDictionary * teste = [categoriaBD objectForKey:[NSString stringWithFormat:@"%i", i]];
        ID = [[teste objectForKey:@"1"] integerValue];
        subcategoriaBD = [categoriaDAO selectSubCategoriaByCategoriaID:ID];

        NSMutableArray* section = [[NSMutableArray alloc] init];
        for (int j = 0; j < [subcategoriaBD count]; j++)
        {
            NSMutableDictionary * subCat = [subcategoriaBD objectForKey:[NSString stringWithFormat:@"%i", j]];
            [section addObject:[NSString stringWithFormat:[subCat objectForKey:@"1"]]];
        }
        [self.data addObject:section];                      
    }

    self.headers = [[NSMutableArray alloc] init];
    for (int i = 0; i < [categoriaBD count]; i++)
    {

        NSString *inStr = [NSString stringWithFormat: @"%i", (int)i];
        nomeCategoria = [categoriaBD objectForKey:inStr];

        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 310, 40)];
        [label setText:[nomeCategoria objectForKey:@"2"]];

        UIView* header = [[UIView alloc] init];

        [header setBackgroundColor:[UIColor colorWithRed:(226/255.0) green:(226/255.0) blue:(226/255.0) alpha:1]];
        [header addSubview:label];
        [self.headers addObject:header];

    }
}

您可以创建自定义 UIPopoverBackgroundView 子类来设置所需箭头的属性。

popoverController.popoverBackgroundViewClass = [MyPopoverBackgroundView class];