|
@@ -37,8 +37,6 @@
|
|
|
|
|
|
@property (nonatomic, strong) CInsertBlankPageCell *preCell;
|
|
|
|
|
|
-@property (nonatomic, strong) UIScrollView *scrcollView;
|
|
|
-
|
|
|
@property (nonatomic, assign) CPDFPageInsertType pageInsertType;
|
|
|
|
|
|
@end
|
|
@@ -89,21 +87,14 @@
|
|
|
[self.cancelBtn addTarget:self action:@selector(buttonItemClicked_cancel:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
[self.headerView addSubview:self.cancelBtn];
|
|
|
|
|
|
- self.scrcollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height-50)];
|
|
|
- self.scrcollView.scrollEnabled = YES;
|
|
|
- self.scrcollView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
|
|
- self.scrcollView.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
|
|
|
- self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 800);
|
|
|
- [self.view addSubview:self.scrcollView];
|
|
|
-
|
|
|
- self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-100) style:UITableViewStylePlain];
|
|
|
+ self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height-100) style:UITableViewStylePlain];
|
|
|
self.tableView.delegate = self;
|
|
|
self.tableView.dataSource = self;
|
|
|
self.tableView.rowHeight = UITableViewAutomaticDimension;
|
|
|
self.tableView.estimatedRowHeight = 44.0;
|
|
|
- self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
|
|
+ self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
|
self.tableView.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
|
|
|
- [self.scrcollView addSubview:self.tableView];
|
|
|
+ [self.view addSubview:self.tableView];
|
|
|
|
|
|
self.isSelect = NO;
|
|
|
self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
|
|
@@ -129,7 +120,6 @@
|
|
|
[super viewWillLayoutSubviews];
|
|
|
self.headerView.frame = CGRectMake(0, 0, self.view.frame.size.width, 50);
|
|
|
self.titleLabel.frame = CGRectMake((self.view.frame.size.width - 200)/2, 0, 200, 50);
|
|
|
- self.scrcollView.frame = CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height-50);
|
|
|
|
|
|
if (@available(iOS 11.0, *)) {
|
|
|
self.saveButton.frame = CGRectMake(self.view.frame.size.width - 60 - self.view.safeAreaInsets.right, 5, 50, 40);
|
|
@@ -169,11 +159,8 @@
|
|
|
}
|
|
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
- CInsertBlankPageCell *cell = [tableView dequeueReusableCellWithIdentifier:@"pageCell"];
|
|
|
- if (cell == nil) {
|
|
|
- cell = [[CInsertBlankPageCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"pageCell"];
|
|
|
- cell.delegate = self;
|
|
|
- }
|
|
|
+ CInsertBlankPageCell *cell = [[CInsertBlankPageCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"pageCell"];
|
|
|
+ cell.delegate = self;
|
|
|
|
|
|
switch (indexPath.row) {
|
|
|
case 0:
|
|
@@ -267,6 +254,8 @@
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
+ cell.delegate = self;
|
|
|
+
|
|
|
return cell;
|
|
|
}
|
|
|
|
|
@@ -326,12 +315,13 @@
|
|
|
}
|
|
|
self.dataArray = (NSArray *)data;
|
|
|
[self.tableView insertRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationFade];
|
|
|
- NSIndexPath* path = [NSIndexPath indexPathForRow:0 inSection:0];
|
|
|
- CInsertBlankPageCell *cell = [self.tableView cellForRowAtIndexPath:path];
|
|
|
-
|
|
|
- NSInteger sizeIndex = [szieArray indexOfObject:cell.sizeLabel.text];
|
|
|
- NSIndexPath *index = [NSIndexPath indexPathForItem:sizeIndex+1 inSection:0];
|
|
|
- [self.tableView selectRowAtIndexPath:index animated:NO scrollPosition:UITableViewScrollPositionMiddle];
|
|
|
+// [self.tableView reloadData];
|
|
|
+// NSIndexPath* path = [NSIndexPath indexPathForRow:0 inSection:0];
|
|
|
+// CInsertBlankPageCell *cell = [self.tableView cellForRowAtIndexPath:path];
|
|
|
+//
|
|
|
+// NSInteger sizeIndex = [szieArray indexOfObject:cell.sizeLabel.text];
|
|
|
+// NSIndexPath *index = [NSIndexPath indexPathForItem:sizeIndex+1 inSection:0];
|
|
|
+// [self.tableView selectRowAtIndexPath:index animated:NO scrollPosition:UITableViewScrollPositionMiddle];
|
|
|
} else {
|
|
|
NSInteger t = indexPath.row;
|
|
|
NSMutableArray *array = [NSMutableArray array];
|