私は何があって私iOSで活気あるテキストを動かすには?
(一種のログインビューのようにあなたは、多くのアプリケーションで参照してくださいね)、数秒間待機してトップにアニメーション化、視野の中心に挨拶アプリを作りたいんテキストをx軸の中央に置くことはできません。私のコードを調べて、間違いが何であるか教えてください。
あなたは// Blur Effect
var blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light)
var blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = view.bounds
view.addSubview(blurEffectView)
// Vibrancy Effect
var vibrancyEffect = UIVibrancyEffect(forBlurEffect: blurEffect)
var vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect)
vibrancyEffectView.frame = view.bounds
// Add label to the vibrancy view
vibrancyEffectView.contentView.addSubview(vibrantLabel)
vibrantLabel.textAlignment = NSTextAlignment.Center
// Add the vibrancy view to the blur view
blurEffectView.contentView.addSubview(vibrancyEffectView)
UIView.animateWithDuration(1, delay: 1, options: .CurveEaseIn, animations: {() -> Void in
self.vibrantLabel.frame = CGRectMake(0, 100, self.vibrantLabel.frame.width, self.vibrantLabel.frame.height)
}, completion: {(finished: Bool) -> Void in
self.view.alpha = 1
})
代わりに、下にあるレイヤーを移動します。 self.vibrantLabel.layer.anchorPointを{0.5,0.5}に設定して、self..vibrantLabel.layer.position = {x、y} –