Tableview disappears after resizing view

following code:

self.dataTableViewController = [[DataTableViewController alloc] initWithStyle:UITableViewStylePlain];
CGRect tableViewRect = self.dataTableViewController.view.frame;
tableViewRect.origin.x = 0.0f;
tableViewRect.origin.y = 91.0f;
//tableViewRect.size.width = 320.0f;
//tableViewRect.size.height = 613.0f;
self.dataTableViewController.view.frame = tableViewRect;
[self.view addSubview:self.dataTableViewController.view];

my tableviewcontroller monitor appears, and everything works and is also positioned in the correct position. but the size of my table is wrong. if I uncomment my two lines of code for the size property, the table view disappears from my uiview and I have no idea why.

some ideas?

// edit:

Ok, weird behavior. my viewcontroller, where my column is displayed, is in the splittableview controller (left)

self.contentSizeForViewInPopover = CGSizeMake(320.0, 704.0);does not affect my popover controller. I left it by default from the splittableviewcontroller template. its always full height if I'm in portrait mode.

uncommenting tableViewRect.size.height = 613.0f; , . 613 , 313 . !? 913.0f , . , 613px. popover , viewcontroller , tableview 613. , .

my tableview 913px:

landscape

portrait

+3
2

. . , , , - , , , , . , , ? , ,

UIViewAutoresizingNone
( viewDidLoad).
+1

... ? ( ):

CGRect tableViewRect = self.tableView.frame;

tableViewRect.origin.x = 0.0f;
tableViewRect.origin.y = 91.0f;
tableViewRect.size.width = 320.0f;
tableViewRect.size.height = 613.0f;

self.tableView.frame = tableViewRect;

[self.tableView setNeedsLayout];
[self.tableView setNeedsDisplay];

. , iPhone 320 x 480, , 613.

0

Source: https://habr.com/ru/post/1787581/


All Articles