Przeglądaj źródła

【会员系统】状态栏按钮长度显示问题

dinglingui 1 tydzień temu
rodzic
commit
495f1424a5

+ 6 - 0
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -414,6 +414,12 @@ NSPopoverDelegate>
             }
         }
         
+        CGFloat buttonWidth = CGRectGetMaxX(self.button.frame);
+        NSRect btnRect = [self.button.attributedTitle boundingRectWithSize:CGSizeMake(MAXFLOAT, CGRectGetHeight(self.button.frame)) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading];
+        if (fabs(buttonWidth-btnRect.size.width)>50) {
+            buttonWidth = btnRect.size.width + 10;
+        }
+        
         self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
         CGRect rect = self.button.frame;
         self.bgImg.frame = rect;