gpt4 book ai didi

ios - UITableViewCell swift 中的滑动模拟

转载 作者:搜寻专家 更新时间:2023-10-30 22:19:04 25 4
gpt4 key购买 nike

在我的应用中首次运行时,我想向用户展示他们可以滑动 TableView 中的单元格以获得更多选项。如何让单元格动画自动滑动 -> 显示选项 -> 然后恢复正常? (滑动模拟) swift ..

这将通知用户滑动单元格有更多选项。

我看到一些应用程序在应用程序的第一次运行时就这样做了。

谢谢

最佳答案

听起来你想做的是一个 UISwipeGestureRecgoniser

示例如下,也许您可​​以实现它:-

func handleMySwipes(sender: UISwipeGestureRecogniser) {

if sender.direction == .Down {

println("you swiped down")

}

if sender.direction == .Right {

println("you swiped right")

}

if sender.direction == .Up {

println("you swiped up")

}

if sender.direction == .Left {

println("you swiped down")

}


override func viewDidLoad() {

//swipe from left for example

swipeRecogniser.direction = .Left

}



//then add it to your view

view.addGestureRecogniser(swipeRecogniser)

}

关于ios - UITableViewCell swift 中的滑动模拟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30874675/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com