首页 文章

uIView在uitableviewcell内转换

提问于
浏览
-1

请帮忙!

我有一个 UITableviewcell ,里面有一个按钮 . 当我点击按钮时,我想要一个 UIView ,其中有3个按钮(隐藏在屏幕边框's width on screen'右侧),可以在旧视图的顶部滑入 . 当用户点击新视图中的其中一个按钮时,它应该滑回原来的位置 . 任何帮助将不胜感激 .

到目前为止我尝试过的是

let offScreenLeft = CGAffineTransformMakeTranslation(-UIScreen.mainScreen().bounds.width,0)
UIView.animateWithDuration(0.4, animations: {
    newview.transform = offScreenLeft
} , completion:{})

提前致谢!

1 回答

  • 0

    如果要使用 CGAffineTransformation ,请设置动画前的起始状态和动画块中的目标状态 . 应该是这样的

    newView.transform = CGAffineTransformMakeTranslation(-UIScreen.mainScreen().bounds.width, 0)
    UIView.animateWithDuration(0.4, animations: {
        newView.transform = CGAffineTransformIdentity
    })
    

相关问题