我的所有UIView框架的高度和宽度均为0

时间:2014-02-22 08:27:29

标签: ios iphone objective-c xcode

我有一个带有视图的故事板,但我的所有UIViews(实际上是UIViewTable和UIScrollView)似乎都有一个frame.width和frame.height为0。

我可以在模拟器中清楚地看到它们。

 - (void) viewDidAppear:(BOOL)animated{

    // check frame size of tableView
    NSLog(@"Frame width = %f, height = %f", self.tableView.frame.size.width, self.tableView.frame.size.height);

    // check contentSize of tableView
    NSLog(@"contentSize width = %f, height = %f", self.tableView.contentSize.width, self.tableView.contentSize.height);

    // check frame size of scrollView
    NSLog(@"scrollView size - width = %f, height = %f", self.scrollView.frame.size.width, self.scrollView.frame.size.height);

    [super viewDidAppear:animated];

}

所有这些日志的高度和宽度均为0。

0 个答案:

没有答案