瀏覽代碼

PDFTools(iOS) - 修复bug 17688 【form】添加OK按钮 ,默认定位到page且填充当前页面(建议默认定位到url,参考安卓)

chenyu 1 年之前
父節點
當前提交
d223ee3341

+ 10 - 1
compdfkit-tools/compdfkit-tools/Annotation/PDFProperties/PDFLink/CPDFFormLinkViewController.m

@@ -69,7 +69,12 @@
            CPDFURLAction * mAction =(CPDFURLAction*)mAnnotation.action;
            self.linkType = CPDFFormLinkTypeLink;
            self.urlTextField.text = mAction.url;
-       }else{
+           if(self.urlTextField.text.length > 0 ) {
+               [self.saveButton setEnabled:YES];
+               self.saveButton.backgroundColor = [UIColor systemBlueColor];
+               [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+           }
+       }else if([mAnnotation.action isKindOfClass:[CPDFGoToAction class]]){
            CPDFButtonWidgetAnnotation * mAnnotation = (CPDFButtonWidgetAnnotation*)self.annotStyle.annotations.firstObject;
            NSUInteger pageIndex = [mAnnotation.page.document indexForPage:mAnnotation.page];
            self.linkType = CPDFFormLinkTypePage;
@@ -80,6 +85,10 @@
                self.saveButton.backgroundColor = [UIColor systemBlueColor];
                [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            }
+       }else{
+           CPDFURLAction * mAction =(CPDFURLAction*)mAnnotation.action;
+           self.linkType = CPDFFormLinkTypeLink;
+           self.urlTextField.text = mAction.url;
        }
 
     }