Changing the Theme of an iOS App with in-app settings and multiple navigation/tab bar and textField custom backgrounds

StackOverflow https://stackoverflow.com/questions/22376607

Question

I have an app which I am working on updating.

The theme right now is a generic purple which is a customised background image for each screen in the app. I set this image in the viewDidLoad of every class:

    UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Newiphonebackground.png"]];
    self.tableView.backgroundView = backgroundImageView;

I have also set a custom navigation bar and tab bar theme in the AppDelegate:

[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
UIImage *navBackgroundImage = [UIImage imageNamed:@"purplynav.png"];
[[UINavigationBar appearance] setBackgroundImage:navBackgroundImage forBarMetrics:UIBarMetricsDefault];
UIImage *tabBackgroundImage = [UIImage imageNamed:@"purplytab.png"];
[[UITabBar appearance] setBackgroundImage:tabBackgroundImage];

I also some textFields in the app which have a specific image loaded in the storyboard.

I am keen to bring new themes to the app but I need to know if I can actually do it in this release, or if it's a bigger task and I have to wait for another.

I have some in-app settings and the user will be able to choose their theme there.

With each theme, I want:

1) To replace every single scene with the new image selected by the user 2) Ensure the navigation and tab bar reflect the new theme 3) Ensure the textFields have a newly set custom background depending on the theme.

How would one go about achieving this? Is it even possible to have a new navigation/tab bar theme?

Any thoughts on this would be really great.

Thanks,

Était-ce utile?

La solution

This is a very broad question. Some searching should get you some of the way, and you can ask more specific questions here later on. Take a look at this SO question, which addresses the same issue: How to create Multiple Themes/Skins for iphone apps?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top