views:

196

answers:

2

Hi All,

I am not developing any web app. I am trying to use CSS in developing iPhone native app. I am confused about where to include it and use it . Whether to use it in the viewDidLoad or applicationDidFinishLaunching . I am really getting tired of using the same UI look. Can any body help me?

Thank You All.

+2  A: 

What are you trying to apply the CSS to? CSS is only going to be applicable to a UIWebView in general. For that, you'll load it in the HTML as you would for a website.

Rob Napier
thank you Rob....can i use css in a normal view?and if on webview then how to do it ... plz suggest me a tutorial or share some code.
socialCircus
and if u have some good css for iphone plz can u share that wid me.
socialCircus
CSS has nothing to do with UIViews. To use a UIWebView, you write a web app. CSS is not the solution to changing the appearance of iPhone apps. If you want to make custom views, you need to study UIView and implement your own drawing routines. But it's nothing at all like CSS. I recommend the iPhone Application Programming Guide (google it). Start with the basics of iPhone development, then study how to customize. iPhone is not skinnable in the way I think you're envisioning. It's intended to make apps look the same so that the users know how they work.
Rob Napier
A UIWebView *is* a UIView. You can use UIWebViews embedded in other views, and some apps do use this for formatted text (for example).
Kendall Helmstetter Gelner
Also, I mean to add, it's perfectly legal to include CSS in a UIWebView html - you do need to set the document root first, your CSS will end up in the resource directory with all the other files.
Kendall Helmstetter Gelner
+3  A: 

The question you seem to be asking is "How can I make my UI skinnable" which is completely independent of any kind of technology for representing those choices.

If you want to built an HTML based application, then you can either have a UIWebView or develop a web-based application, both of which can be skinned with CSS.

If you want to make a UIKit application customisable (by changing background colours etc. and the like) then you'll have to roll your own way of doing that. CSS would be overkill for this purpose, and in any case, there is no 'standard' support for themeing applications. You might as well just write into the user defaults (probably via a settings bundle) what the user would prefer as a background colour etc. and then write a method to traverse your UIKit hierarchy to change the background colour as appropriate.

AlBlue
thank you AlBlue,that was really helpful.
socialCircus