Discussion Forums  >  Uncategorized

Replies: 2    Views: 286

MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
08/15/11 05:17 PM (14 years ago)

Is it possible to switch a theme within an app?

Has anyone tried this? I'd like to set up several themes (iOS using 1.5) and give the user an option to select a theme and have the app refresh with the new theme and then remember it. I poked around in the BT_application.m file and see how it parses the themes array, but not able to figure a way to load an alternate. Anyone have any thoughts on this?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/16/11 12:18 AM (14 years ago)
Hmm... because the app uses an array of themes in the config data, it's possible to add more than one theme object to the list. The app looks for the first theme and uses that. But, lets assume you have several themes... a) Create a button or a menu item somewhere that triggers a method to 'change theme' Not sure how you'll wire this up? Oh, maybe a plug-in screen to load on a button tap, that plug-in screen could do the theme-switchign when it loads? b) In this new screen somewhere, probably in the onLoad method, you'll need to identify what theme to use. Let say you have 3 in the list, you could use theme 2 for example. c) Next, you'll need to re-set the theme property in the root app. Like: [appDelegate.rootApp setRootTheme:myNewThemeData] To get myNewThemeData you'll need to use: BT_item *myNewThemeData = [appDelegate.rootApp getThemeByItemId:the id of the theme you want to use] Not sure what will happen but is plausible?
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
08/16/11 08:07 AM (14 years ago)
Thanks. I'll let you know if I get this to work.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.