uiview 使用 swift4 动画转换为从右到左 (RTL)



我需要对UIView进行动画处理。 动画方向像从右到左。(劳教(我使用从左到右(LTR(的动画代码如下 (升(法典:

UIView.animate(withDuration: 0.5, delay: 0.25, options: UIViewAnimationOptions(),
animations: { () -> Void in
self.viewSideMenuHolder.frame = CGRect(x: 0, y: 0,width: self.view.frame.size.width ,height: self.view.frame.size.height)
},
completion: { (finished: Bool) -> Void in
self.viewSideMenuHolder.backgroundColor = UIColor.black.withAlphaComponent(0.5)
})
}

我需要更改 UIView 动画方向是 (RTL( 任何一个帮助我。

我得到了解决方案。 解决方案是..

UIView.animate(withDuration: 0.5, delay: 0.25, options: UIViewAnimationOptions(), animations: { () -> Void in
self.viewSideMenuHolder.frame = CGRect(x: self.view.frame.size.width, y: 0,width: self.view.frame.size.width ,height: self.view.frame.size.height)
}, completion: { (finished: Bool) -> Void in
self.viewSideMenuHolder.backgroundColor = UIColor.clear
})

最新更新