From 762ede5223c2ad2a5f0a69c5d8e0a81f57c2a580 Mon Sep 17 00:00:00 2001 From: Hulk Date: Wed, 18 May 2022 16:04:06 +0800 Subject: [PATCH] fix --- .../Generator/PrismControlInstructionGenerator.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iOS/DiDiPrism/Src/Core/Instruction/Generator/PrismControlInstructionGenerator.m b/iOS/DiDiPrism/Src/Core/Instruction/Generator/PrismControlInstructionGenerator.m index a95e34c..20c473f 100644 --- a/iOS/DiDiPrism/Src/Core/Instruction/Generator/PrismControlInstructionGenerator.m +++ b/iOS/DiDiPrism/Src/Core/Instruction/Generator/PrismControlInstructionGenerator.m @@ -62,8 +62,11 @@ + (NSString*)getViewContentOfControl:(UIControl*)control { // 兜底考虑把UIButton仅作为给父View添加触控能力的工具控件的场景(此时UIButton通常就是个空白按钮),此时向上遍历真正有意义的父级View。 if (!viewContent.length && [control isKindOfClass:[UIButton class]]) { UIView *superView = control.superview; - if (superView && CGRectEqualToRect(control.frame, superView.bounds)) { - viewContent = [PrismInstructionContentUtil getRepresentativeContentOfView:superView needRecursive:YES]; + if (superView && !CGRectIsEmpty(superView.bounds)) { + if (CGRectEqualToRect(control.frame, superView.bounds) + || ((control.frame.size.width * control.frame.size.height) / (superView.bounds.size.width * superView.bounds.size.height) > 0.99)) { + viewContent = [PrismInstructionContentUtil getRepresentativeContentOfView:superView needRecursive:YES]; + } } } return viewContent;