问题
My UITableView, when I po the frame in the debugger, reports its width and height as 600x600. I have it pinned to the sides of its view controller, so I don't understand why it would be reporting this.
The 600x600 is its dimensions within the Any x Any Storyboard grid, but like I said, it should be updating.
Is this a glitch?
回答1:
It will report 600x600 dimensions until its layout is complete. If you override viewDidLayoutSubviews method and put a breakpoint there:
- (void) viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
//
// NSLog frame here
}
You will get proper frame size.
来源:https://stackoverflow.com/questions/27207644/why-does-my-uitableview-report-itself-as-600x600-or-what-it-is-in-the-storyboar