简体   繁体   中英

UIView transition inside uitableviewcell

Please help!

I have a UITableviewcell with a button in it. When i click the button i want a UIView which has 3 buttons (which is hidden outside to screen bound's width on screen's right side) to slide in on top of the old view.And when user clicks on one of the buttons in new view it should slide back to its old position. Any help will be greatly appreciated.

What i have tried so far is

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

Thanks in Advance!

In case you want to use CGAffineTransformation , set the starting state before the animation, and the target state in the animation block. Should be like this

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM