Browse Source

PDFTools(iOS) - Viwer bug处理

chenyu 1 year ago
parent
commit
1b2bfb808c

+ 2 - 2
compdfkit-tools/compdfkit-tools/Common/Views/PDFNavigationRightView/CNavigationRightView.m

@@ -101,7 +101,7 @@ typedef void (^Clickback) (NSUInteger tag);
 
 - (void)configurationUI {
     
-    CGFloat offset = 10;
+    CGFloat offset = 20;
     if (UIUserInterfaceIdiomPad == UI_USER_INTERFACE_IDIOM()) {
         offset = 20;
     }
@@ -123,7 +123,7 @@ typedef void (^Clickback) (NSUInteger tag);
         [button addTarget:self action:@selector(buttonClickItem:) forControlEvents:UIControlEventTouchUpInside];
         [self addSubview:button];
         if(i == self.dataArray.count - 1){
-            width += offset;
+            width += 0;
         }else{
             width += (button.frame.size.width + offset);
         }

+ 1 - 2
compdfkit-tools/compdfkit-tools/Common/Views/PDFNavigationRightView/NavigationRightImage.xcassets/CNavigationImageNameMore.imageset/Contents.json

@@ -1,16 +1,15 @@
 {
   "images" : [
     {
+      "filename" : "More.pdf",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
-      "filename" : "More@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
-      "filename" : "More@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

+ 95 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFNavigationRightView/NavigationRightImage.xcassets/CNavigationImageNameMore.imageset/More.pdf

@@ -0,0 +1,95 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 0.750000 0.750000 cm
+0.262745 0.278431 0.301961 scn
+1.500000 9.250000 m
+1.500000 13.530207 4.969793 17.000000 9.250000 17.000000 c
+13.530207 17.000000 17.000000 13.530207 17.000000 9.250000 c
+17.000000 4.969793 13.530207 1.500000 9.250000 1.500000 c
+4.969793 1.500000 1.500000 4.969793 1.500000 9.250000 c
+h
+9.250000 18.500000 m
+4.141366 18.500000 0.000000 14.358634 0.000000 9.250000 c
+0.000000 4.141366 4.141366 0.000000 9.250000 0.000000 c
+14.358634 0.000000 18.500000 4.141366 18.500000 9.250000 c
+18.500000 14.358634 14.358634 18.500000 9.250000 18.500000 c
+h
+5.250000 8.000000 m
+5.940356 8.000000 6.500000 8.559644 6.500000 9.250000 c
+6.500000 9.940356 5.940356 10.500000 5.250000 10.500000 c
+4.559644 10.500000 4.000000 9.940356 4.000000 9.250000 c
+4.000000 8.559644 4.559644 8.000000 5.250000 8.000000 c
+h
+9.250000 8.000000 m
+9.940355 8.000000 10.500000 8.559644 10.500000 9.250000 c
+10.500000 9.940356 9.940355 10.500000 9.250000 10.500000 c
+8.559645 10.500000 8.000000 9.940356 8.000000 9.250000 c
+8.000000 8.559644 8.559645 8.000000 9.250000 8.000000 c
+h
+14.500000 9.250000 m
+14.500000 8.559644 13.940356 8.000000 13.250000 8.000000 c
+12.559644 8.000000 12.000000 8.559644 12.000000 9.250000 c
+12.000000 9.940356 12.559644 10.500000 13.250000 10.500000 c
+13.940356 10.500000 14.500000 9.940356 14.500000 9.250000 c
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  1402
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 20.000000 20.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000001492 00000 n
+0000001515 00000 n
+0000001688 00000 n
+0000001762 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1821
+%%EOF

BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFNavigationRightView/NavigationRightImage.xcassets/CNavigationImageNameMore.imageset/More@2x.png


BIN
compdfkit-tools/compdfkit-tools/Common/Views/PDFNavigationRightView/NavigationRightImage.xcassets/CNavigationImageNameMore.imageset/More@3x.png


+ 8 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFPopMenu/CPDFPopMenu.h

@@ -14,6 +14,11 @@
 
 @class CPDFPopMenu;
 
+@protocol CPDFPopMenuDelegate <NSObject>
+
+- (void)MenuDidClosedIn:(CPDFPopMenu *)menu isClosed:(BOOL)isClosed;
+
+@end
 
 @interface CPDFPopMenu : UIView
 
@@ -25,6 +30,9 @@
 
 @property(nonatomic, assign, getter=isDimCoverLayer) BOOL dimCoverLayer;
 
+@property (nonatomic,assign) id<CPDFPopMenuDelegate> delegate;
+
+
 - (instancetype) initWithContentView:(UIView *) contentView;
 + (instancetype) popMenuWithContentView:(UIView *) contentView;
 - (void) showMenuInRect:(CGRect) rect;

+ 8 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFPopMenu/CPDFPopMenu.m

@@ -81,6 +81,10 @@
 
         [self.backgroundContainer addSubview:self.contentView];
     }
+    
+    if(self.delegate && [self.delegate respondsToSelector:@selector(MenuDidClosedIn:isClosed:)]) {
+        [self.delegate MenuDidClosedIn:self isClosed:NO];
+    }
 }
 
 - (void)layoutSubviews {
@@ -90,6 +94,10 @@
 - (void) hideMenu {
 
     [self removeFromSuperview];
+    
+    if(self.delegate && [self.delegate respondsToSelector:@selector(MenuDidClosedIn:isClosed:)]) {
+        [self.delegate MenuDidClosedIn:self isClosed:YES];
+    }
 }
 
 #pragma mark - Property