From c2b07e4a20789c1497eb09f1c604ee23da6ef67e Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 3 Sep 2021 16:10:06 +0800 Subject: [PATCH] iOS: fix tableview height cannot fit the screen --- doric-iOS/Example/Example/ViewController.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doric-iOS/Example/Example/ViewController.m b/doric-iOS/Example/Example/ViewController.m index 7883185f..46432875 100644 --- a/doric-iOS/Example/Example/ViewController.m +++ b/doric-iOS/Example/Example/ViewController.m @@ -39,6 +39,14 @@ - (void)viewDidLoad { }]; [tmp insertObject:@"Dev Kit" atIndex:0]; self.demoFilePaths = tmp; + + [Doric registerLibrary:[DemoLibrary new]]; + [Doric enablePerformance:YES]; + [Doric enableRenderSnapshot:YES]; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; [self.view addSubview:[[UITableView new] also:^(UITableView *it) { it.width = self.view.width; it.height = self.view.height; @@ -46,9 +54,6 @@ - (void)viewDidLoad { it.dataSource = self; it.delegate = self; }]]; - [Doric registerLibrary:[DemoLibrary new]]; - [Doric enablePerformance:YES]; - [Doric enableRenderSnapshot:YES]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {