fix unable to reorder setting items in favorite menu by long pressing
This commit is contained in:
1 parent
73de0877a1
commit
1f13fd691b
1 file changed
+4
-3
@@ -788,12 +788,11 @@ BOOL isCustomResolution(CGSize res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(currentSettingsMenuMode == FavoriteSettings){
|
if(currentSettingsMenuMode == FavoriteSettings){
|
||||||
if(!capturedStack) return;
|
|
||||||
|
|
||||||
switch (gesture.state) {
|
switch (gesture.state) {
|
||||||
case UIGestureRecognizerStateBegan:
|
case UIGestureRecognizerStateBegan:
|
||||||
// 创建快照视图
|
// 创建快照视图
|
||||||
[self findCapturedStackByTouchLocation:locationInParentStack];
|
[self findCapturedStackByTouchLocation:locationInParentStack];
|
||||||
|
if(capturedStack == nil) return;
|
||||||
|
|
||||||
snapshot = [capturedStack snapshotViewAfterScreenUpdates:YES];
|
snapshot = [capturedStack snapshotViewAfterScreenUpdates:YES];
|
||||||
//snapshot.center = capturedStack.center;
|
//snapshot.center = capturedStack.center;
|
||||||
@@ -805,6 +804,7 @@ BOOL isCustomResolution(CGSize res) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UIGestureRecognizerStateChanged:
|
case UIGestureRecognizerStateChanged:
|
||||||
|
if(capturedStack == nil) return;
|
||||||
snapshot.center = locationInParentStack;
|
snapshot.center = locationInParentStack;
|
||||||
// NSLog(@"coordY in rootView: %f", locationInRootView.y);
|
// NSLog(@"coordY in rootView: %f", locationInRootView.y);
|
||||||
[self handleAutoScroll:locationInRootView];
|
[self handleAutoScroll:locationInRootView];
|
||||||
@@ -814,6 +814,7 @@ BOOL isCustomResolution(CGSize res) {
|
|||||||
break;
|
break;
|
||||||
case UIGestureRecognizerStateCancelled:
|
case UIGestureRecognizerStateCancelled:
|
||||||
case UIGestureRecognizerStateEnded:
|
case UIGestureRecognizerStateEnded:
|
||||||
|
if(capturedStack == nil) return;
|
||||||
// 更新快照视图位置
|
// 更新快照视图位置
|
||||||
[self stopAutoScroll];
|
[self stopAutoScroll];
|
||||||
[snapshot removeFromSuperview];
|
[snapshot removeFromSuperview];
|
||||||
@@ -900,7 +901,7 @@ BOOL isCustomResolution(CGSize res) {
|
|||||||
[stack addSubview:button];
|
[stack addSubview:button];
|
||||||
[NSLayoutConstraint activateConstraints:@[
|
[NSLayoutConstraint activateConstraints:@[
|
||||||
[button.trailingAnchor constraintEqualToAnchor:stack.trailingAnchor constant:-4],
|
[button.trailingAnchor constraintEqualToAnchor:stack.trailingAnchor constant:-4],
|
||||||
[button.bottomAnchor constraintEqualToAnchor: stack.arrangedSubviews[0].bottomAnchor constant:0],
|
[button.bottomAnchor constraintEqualToAnchor:stack.arrangedSubviews[0].bottomAnchor constant:0],
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user