如何删除“模糊”在UIPopoverController中投影 [英] How to remove the "fuzzy" drop shadow in the UIPopoverController

查看:105
本文介绍了如何删除“模糊”在UIPopoverController中投影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当UIPopoverController的视图出现时,我不想要投影。有没有办法删除这个阴影外观?

I don't want the drop shadow when the UIPopoverController's view appears. Is there a way to remove this drop shadow look?

推荐答案

不是直截了当,但是从iOS 5起,你可以制作自己的使用UIPopoverBackgroundView自定义弹出窗口背景。

Not straight forward, but since iOS 5, you can make your own custom popover background using UIPopoverBackgroundView.

请参阅此问题的答案:使用UIPopoverBackgroundView类。它指向一个好的tuto。

See the answer for this question: Using UIPopoverBackgroundView class. It's pointing to a good tuto.

然后,在UIPopoverBackgroundView实现的initWithFrame中,您可以使用clearColor作为投影。使用偏移和半径对我来说不起作用。

Then, in the initWithFrame of your UIPopoverBackgroundView implementation, you can use a clearColor for the drop shadow. Using offset and radius did not work for me.

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {

        self.layer.shadowColor = [[UIColor clearColor] CGColor];
    }
    return self;
}

这篇关于如何删除“模糊”在UIPopoverController中投影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆