gpt4 book ai didi

objective-c - 如何处理屏幕底部的滑动手势

转载 作者:行者123 更新时间:2023-12-01 18:00:02 25 4
gpt4 key购买 nike

我有一个具有三个屏幕的应用程序,当用户从 ipad 屏幕底部向上滑动时,我想显示和隐藏一个小的 uiview。我知道这不能通过正常的滑动手势来解决。我想知道你能否告诉我如何处理这些滑动手势?

最佳答案

将 UIPanGestureRecognizer 添加到您的 View 中。

-(void) panDetected:(UIGestureRecognizer *) gesture 
{
BOOL fromBottom = NO;
CGPoint loc = [gesture locationInView:self.view];

if(gesture.state == UIGestureRecognizerStateBegan)
{
if(loc is somewhere in the bottom of view)
fromBottom = YES;
}
else if(gesture.state == UIGestureRecognizerStateChanged)
{
// You can up your view with finger movement here


}
else if(gesture.state == UIGestureRecognizerStateEnded)
{

}
}

关于objective-c - 如何处理屏幕底部的滑动手势,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11386438/

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