标签:uiview oat ipa max sele set ios 计算 趋势
添加滑动手势
//添加滑块
UIPanGestureRecognizer *recognizerA = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
[recognizerA setMaximumNumberOfTouches:1];
//滑块大小
_AView = [[UIView alloc] initWithFrame:CGRectMake(0,0, 100,150)];
[_AView addGestureRecognizer:recognizerA];
/**
* @brief 滑动模块
*/
#pragma mark --滑动模块
- (IBAction)handlePan:(UIPanGestureRecognizer *)recognizer {
//松开手指时判断滑动趋势让其计算滑动位子
if (recognizer.state == UIGestureRecognizerStateEnded) {
[self updateRelationships];
}
}
/**
* @brief 滑动大小
*/
#pragma mark --滑动大小
-(void)updateRelationships{
NSLog(@"update-CGFloat_x::%f",AView.frame.origin.x);
NSLog(@"update-CGFloat_x::%f",AView.frame.origin.y);
}
iOS滑动手势UIPanGestureRecognizer 注意事项
标签:uiview oat ipa max sele set ios 计算 趋势
原文地址:https://www.cnblogs.com/lanmaokomi/p/8796620.html