ios - Restyle whole App UI on event - What is the best approach? -


this pattern/design question following setup:

my app has different styling during day/night, includes:

  • background images
  • font sizes , colors
  • ui element positioning
  • button images
  • etc...

the uiappearance proxy protocol used as possible, storyboard. nevertheless of styling done in specific views viewdidload methods, has updated well.

the problem:

when app active during switch day night , vice versa newly created ui elements styled according new setting, expected, elements, present during previous setting remain unstyled. how can trigger restyle on ui elements?

ideas:

  • can somehow trigger complete ui redraw? (including calling each views viewdidload?)
  • do have move styling viewdidload methods layoutsubviews , call layoutifneeded?
  • is there more conveniant way?

did quick google search , found this:

// update uiappearance...  nsarray *windows = [uiapplication sharedapplication].windows; (uiwindow *window in windows) {     (uiview *view in window.subviews) {         [view removefromsuperview];         [window addsubview:view];     } } 

... http://snipplr.com/view/75259/refresh-uiappearance-after-application-loaded/

it quite reloads entire view hierarchy. you'll need put somewhere that's triggered @ specific time intervals.

hope works =]


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -