I'm working with a simple iPad application, and I've got a simple problem. I'm setting up a custom UIView; here's my initWithFrame:
- (id)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame]))
{
self.backgroundColor = [UIColor colorWithWhite:.4 alpha:1.0];
....
}
return self;
}
The problem is that when the app starts, in this view the background color is not applied, even though the rest of the init is running (controls are added, etc). When I rotate the device though, the background color is applied, and will remain applied for the lifetime of the app. I think I'm missing a layout command somewhere, but I'm not sure where. Any ideas?
EDIT 2
Here's the call to init the view. These methods are in my ViewController.
-(id)initWithFrame:(CGRect)_rect
{
rect = _rect;
if(self = [super init])
{
......
}
return self;
}
- (void)loadView
{
[super loadView];
myView = [[MyView alloc]
initWithFrame:rect];
self.view = myView;
}