gpt4 book ai didi

ios - 是否可以在节标题下方添加刷新控件

转载 作者:行者123 更新时间:2023-11-28 06:06:38 25 4
gpt4 key购买 nike

我有一个带有节标题的表格 View 。我想在节标题下方而不是在 tableview 顶部添加刷新控件。这可能吗??

最佳答案

不。这是不可能的。尝试在部分标题中添加一个事件指示器。如果您希望事件指示器仅在用户下拉时显示,而 tableview 内容偏移量为 0,则尝试添加平移手势并仅针对此特定条件实现它

        var panGesture = UIPanGestureRecognizer(target: self, action: #selector(swipedDown))
self.HometableView.addGestureRecognizer(panGesture)
panGesture.delegate = self as! UIGestureRecognizerDelegate

//处理平移手势的代码

func swipedDown(panGesture: UIPanGestureRecognizer)
{
let velocity: CGPoint = panGesture.velocity(in: HometableView)
if velocity.y > 0 {
print("gesture moving Up")
if(HometableView.contentOffset == CGPoint.zero)
{
print("************SWIPED DOWN")
//Do the logic to increase section header height and show the activity indicator

}

}
else {
print("gesture moving Bottom")



}


}

func gestureRecognizerShouldBegin(_ panGestureRecognizer: UIPanGestureRecognizer) -> Bool {

let velocity: CGPoint = panGestureRecognizer.velocity(in: HometableView)
if velocity.y > 0 {
if(HometableView.contentOffset == CGPoint.zero)
{
return true
}
}
return false
}

关于ios - 是否可以在节标题下方添加刷新控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48017976/

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