Преглед изворни кода

PDFTools(iOS)-选择文档后注释属性bar的刷新

yangliuhua пре 1 година
родитељ
комит
040e69e1d4

+ 2 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m

@@ -141,7 +141,9 @@
 
 - (void)selectDocumentRefresh {
     self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
+    [self.annotationBar updatePropertiesButtonState];
     [self.annotationBar reloadData];
+    [self.annotationBar updateUndoRedoState];
 }
 
 #pragma mark - Private Methods

+ 2 - 0
ComPDFKit/ComPDFKit/CPDFViewController.m

@@ -160,7 +160,9 @@
 
 - (void)selectDocumentRefresh {
     self.pdfListView.annotationMode = CPDFViewAnnotationModeNone;
+    [self.annotationBar updatePropertiesButtonState];
     [self.annotationBar reloadData];
+    [self.annotationBar updateUndoRedoState];
 }
 
 #pragma mark - Private

+ 4 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.h

@@ -68,6 +68,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)reloadData;
 
+- (void)updatePropertiesButtonState;
+
+- (void)updateUndoRedoState;
+
 - (void)buttonItemClicked_open:(UIButton *)button;
 
 - (void)openSignatureAnnotation:(CPDFSignatureWidgetAnnotation *)signatureAnnotation;

+ 6 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -303,6 +303,12 @@
     }
 }
 
+- (void)updateUndoRedoState {
+    self.undoBtn.enabled = NO;
+    self.redoBtn.enabled = NO;
+    [self.pdfListView registerAsObserver];
+}
+
 #pragma mark - Action
 
 - (void)buttonItemClicked_Switch:(UIButton *)button {