我添加了两个按钮UIVisualEffectView
,效果UIVibrancyEffect
如下:
let vibrancyEffectView = UIVisualEffectView(effect: UIVibrancyEffect(forBlurEffect: UIBlurEffect(style: .Dark)))
vibrancyEffectView.contentView.addSubview(rightActionButton)
vibrancyEffectView.contentView.addSubview(leftActionButton)
巢为它们设置了标题:
rightActionButton.setTitle(rightAction.title, forState: .Normal)
leftActionButton.setTitle(leftAction?.title, forState: .Normal)
并且backgroundColor
:
leftActionButton.backgroundColor = UIColor.clearColor()
rightActionButton.backgroundColor = UIColor.whiteColor()
为什么我看不到正确的标题?如何解决这个问题?
以下是 Apple 的示例,正是我需要做的:
可能吗?