and thanks in advance.
I am looking for tips on how to compose view controllers in my application, where I still have a constant background and some background animations
Here's how it is currently configured:
- AppDelegate creates a navigation controller, RootViewController and Sprite Layer (subclasses of UIView)
- AppDelegate also saves the background image as a backgroundColor property
- the navigation controller is initialized by the root view controller, as usual.
- the rootview controller pushes different types of tables onto the navigation stack
And in the code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIImageView* backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"underthesea.jpg"]] autorelease];
backgroundView.contentMode = UIViewContentModeScaleAspectFill;
backgroundView.frame = [UIScreen mainScreen].bounds;
self.viewController = [[[RootViewController alloc] init] autorelease];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
self.spriteLayer = [[[SpriteLayer alloc] initWithFrame:self.viewController.view.frame] autorelease];
self.viewController.spriteLayer = self.spriteLayer;
[window addSubview:backgroundView];
[window addSubview:self.spriteLayer];
[window addSubview:self.navigationController.view];
[window makeKeyAndVisible];
return YES;
}
`
, . , , UIViewController.
, SpriteLayer UIViewController, ; , . , , , , StackOverflow, .
?
Cheers,
P.S. C . , , , , , - . - ? .