サブビューのフレームを設定したときに変更が画面に反映されない理由を誰かが知っているのではviewDidLoadないかと思いviewWillAppearましたが、設定した場合は影響しviewDidAppearますか?
私の場合、2つのテーブルビューを含むカスタムxibをロードしてから、それらを下にシフトして、viewDidLoad追加される別のビュー用のスペースを確保しようとしviewDidLoadています。これは、必ずしも表示する必要がないためです。
問題は、フレームを設定しviewDidLoadたり、オブジェクトに設定したりviewWillAppearすると、印刷して確認できますが、画面に反映されないことです。設定したフレーム呼び出しをに移動するviewDidAppearと、すべてが期待どおりに機能します。
フレームをセットできるはずだと思うのは間違っていますviewDidLoadか?
- (id)init {
    if ( self = [super initWithNibName:@"MyView" bundle:nil] ) {}
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.descriptionWebView = [[[UIWebView alloc] initWithFrame:CGRectMake( 0, 0, self.view.frame.size.width, 200 )] autorelease];
    [self.view addSubview:self.descriptionWebView];
    self.tableView1.autoresizingMask = UIViewAutoresizingNone;
    self.tableView2.autoresizingMask = UIViewAutoresizingNone;
    [self.descriptionWebView loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"...." withExtension:@"html"]]];
    table1LocationWithHeader = CGRectMake( self.tableView1.frame.origin.x, 200, self.tableView1.frame.size.width, self.tableView1.frame.size.height - 200 );
    table2LocationWithHeader = CGRectMake( self.tableView2.frame.origin.x, 200, self.tableView2.frame.size.width, self.tableView2.frame.size.height - 200 );
    //this will NOT work
    self.tableView1.frame = table1LocationWithHeader;
    self.tableView2.frame = table2LocationWithHeader;
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    //this will NOT work
    self.tableView1.frame = table1LocationWithHeader;
    self.tableView2.frame = table2LocationWithHeader;
}
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    //this WILL work
    self.tableView1.frame = table1LocationWithHeader;
    self.tableView2.frame = table2LocationWithHeader;
}
//I added these after comments for stack overflow users, it seems like viewDidLayoutSubviews is the best place to set the frame
- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    //this will NOT work
    self.tableView1.frame = table1LocationWithHeader;
    self.tableView2.frame = table2LocationWithHeader;
}
- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
    //this WILL work
    self.tableView1.frame = table1LocationWithHeader;
    self.tableView2.frame = table2LocationWithHeader;
}