在MKMapView上模糊 [英] Blur on MKMapView
本文介绍了在MKMapView上模糊的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道之前曾有人问过这个问题,但是我试图在我的应用程序的地图视图中添加模糊效果.我尝试过的所有操作都只是对地图进行着色,包括如下代码:
I know this question has been asked before, but I am trying to put a blur on a map view in my app. Everything I've tried just tints the map including code like this:
var darkBlur = UIBlurEffect(style: UIBlurEffectStyle.Dark)
var blurView = UIVisualEffectView(effect: darkBlur)
blurView.frame = mapView.bounds
mapView.addSubview(blurView)
有没有一种方法可以使地图模糊?
Is there a way to actually blur the map?
推荐答案
您是否尝试将blurView
添加到mapView
的超级视图中?
Did you try adding blurView
to mapView
's superview?
在Playground上对我来说效果很好
Works fine for me in Playground:
这篇关于在MKMapView上模糊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文