我使用UIVisualEffectView来模糊SpriteKit中的一部分屏幕,如下所示:
let blur:UIBlurEffect = UIBlurEffect(style: UIBlurEffectStyle.Dark)
let UIEffectView:UIVisualEffectView = UIVisualEffectView(effect: blur)
UIEffectView.frame = CGRectMake(0, 0, frame.width, frame.height * 0.15)
self.view?.addSubview(UIEffectView)
但它显示为灰色阴影区域而不是模糊。奇怪的是,它在开始时GameCenter通知显示时模糊,说"欢迎回来,(玩家)" - 但是一旦通知消失,它就会变回灰色框。
同样适用于在iOS9中进入多任务视图时,预览的部分模糊,但当您进入应用程序时,它会再次变为灰色阴影区域。
为什么会发生这种情况?它在模拟器和物理硬件中也是如此。
答案 0 :(得分:0)
我在use UIVisualEffectView to create a blur view, correct on simulator but not on iphone & ipad之前遇到了同样的问题,当你将git push
与#! /bin/sh
#
# Push, and set upstream if the push succeeds and
# there was no upstream set before the push started,
# based on "push.set-upstream" setting
die() {
printf "%s\n" "$1" 1>&2
exit 1
}
get_current_branch() {
git symbolic-ref -q --short HEAD ||
die "fatal: not currently on a branch"
}
get_remote() {
git config --get branch."$1".remote || echo origin
}
upstream_is_set() {
git rev-parse -q --verify "$1@{u}" >/dev/null 2>&1
}
# arguments are: [remote [branch]]
# we do not accept arbitrary refspecs here!
case $# in
0) branch=$(get_current_branch) || exit $?
remote=$(get_remote "$branch")
;;
1) remote="$1"
branch=$(get_current_branch) || exit $?
;;
2) remote="$1" branch="$2";; # should check $2 ref format?
*) die "usage: gitpush [remote [branch]]";;
esac
how_to_set=$(git config --get push.set-upstream || echo auto)
case "$how_to_set" in
always|true) do_set=true;;
false) do_set=false;;
auto|only-if-unset) if upstream-is-set "$branch"; then
do_set=false
else
do_set=true
fi;;
*) die "fatal: don't understand push.set-upstream=$how_to_set";;
esac
# figured everything out, so now push; fail if push fails
git push "$remote" "$branch" || exit $?
# last, set upstream if still needed
if $do_set; then git branch --set-upstream-to "$remote/$branch"; fi
混为一谈时,可能会发生奇怪的事情。我建议使用UIKit
来执行模糊作业,而不是SpriteKit
。