views:

39

answers:

0

The the problem arises when i dynamically load subview from nib and add it to the current main view during viewDidLoad.

UIView *someView = // load from nib
someView.frame 
    = CGRectMake(.0, 
                .0, 
                kFormSheetWidth /* = 540.0 */, 
                kFormSheetHeight) /* = 576.0 */;
[self.view addSubview:someView];

It all happens inside FormSheet window, where UINavigationController instance was passed into presentModalViewController:. But, someView always resizes itself to be by 220.0 larger and by 116.0 higher and thus doesn't fit into window.

someView nib looks like

UITableView
xx UIView
xxxx UITextInput
xx UIButton

All these views have autoresizeSubviews == YES, clipSubviews == YES.

It's very surprising behavior. Interestingly, when I set the frame of someView in viewWillAppear:, everything looks fine. What (where) should I look for to tackle this thing?