|
|
@@ -66,11 +66,32 @@
|
|
|
|
|
|
@implementation CommonEditorViewController
|
|
|
|
|
|
+
|
|
|
+- (void)viewDidLayoutSubviews {
|
|
|
+ [super viewDidLayoutSubviews];
|
|
|
+ [self resize_tableHeader];
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - Code TableView
|
|
|
+- (UIView*)get_tableHeader
|
|
|
+{
|
|
|
+ return [UIView new];
|
|
|
+}
|
|
|
+-(void) resize_tableHeader
|
|
|
+{
|
|
|
+ //利用systemLayoutSizeFittingSize:计算出真实高度
|
|
|
+ CGFloat height = [self.editorTable.tableHeaderView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
|
|
|
+ CGRect headerFrame = self.editorTable.tableHeaderView.frame;
|
|
|
+ headerFrame.size.height = height;//20是留的上下边距
|
|
|
+ //修改tableHeaderView的frame
|
|
|
+ self.editorTable.tableHeaderView.frame = headerFrame;
|
|
|
+}
|
|
|
- (void)initTableView {
|
|
|
|
|
|
self.editorTable = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
|
|
self.editorTable.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+
|
|
|
[self.tableContainer addSubview:self.editorTable];
|
|
|
[self.tableContainer sendSubviewToBack:self.editorTable];
|
|
|
|
|
|
@@ -119,8 +140,8 @@
|
|
|
self.editorTable.delegate = self;
|
|
|
self.editorTable.dataSource = self;
|
|
|
self.editorTable.tableFooterView = [UIView new];
|
|
|
- self.editorTable.tableHeaderView = [UIView new];
|
|
|
-
|
|
|
+// self.editorTable.tableHeaderView = [UIView new];
|
|
|
+ self.editorTable.tableHeaderView = [self get_tableHeader];
|
|
|
}
|
|
|
|
|
|
- (void)registerPhoneCell {
|