开发者

Dynamic font change and font color changes in Iphone application

开发者 https://www.devze.com 2023-04-05 15:35 出处:网络
I have an application which get the settings values such as font color style etc from API. The user can edit those values from web view and those need to be reflected in the APP.

I have an application which get the settings values such as font color style etc from API.

The user can edit those values from web view and those need to be reflected in the APP.

Can any one suggest the bes开发者_运维问答t method to integrate with the app.??


My suggestion:

  • Use a convenient JSON framework, such as stig's JSON-Framework.
  • Get the info from the server in JSON format (obviously), via NSURLConnection (documentation here).
  • Assign the properties of your UI elements such as textColor, font etc.

Seems doable - but based on the given information I would perhaps recommend to let your users do that from within the app. It would be much more intuitive.

EDIT: More specific implementation info.

You can simply use global variables. E.g., make a class Formats which stores all the values you need, fetching and parsing them as necessary (lazily). Then, when you need certain formatting, just use code like

Formats *format = [[[Formats alloc] init] autorelease];  // or pass a reference
myNameTextField.textColor = [format textColorForNames];
0

精彩评论

暂无评论...
验证码 换一张
取 消