Laxiton6893
Laxiton6893

Reputation: 201

CSS styles only for iOS web app?

Does anyone know if its possible to have CSS exclusive to an iOS web app?

ie. If the standalone web app is open call this style (vs. the style sheet of the mobile website web in Safari). I'd assume it be done with JS but can't find documentation.

Upvotes: 0

Views: 1006

Answers (2)

Sachinbabu
Sachinbabu

Reputation: 1

You can create Html file with css file.just include the content file in web view

NSString *fileString = [[NSBundle mainBundle] pathForResource: @"privacypolicy" ofType:@"html"];
myWebView = [[UIWebView alloc]init];
NSString *newHTMLString = [[NSString alloc] initWithContentsOfFile: fileString encoding: NSASCIIStringEncoding error: NULL];
NSURL *newURL = [[NSURL alloc] initFileURLWithPath: fileString];

Its work fine

Upvotes: 0

Gopikrishna
Gopikrishna

Reputation: 857

 //Lines split for easy reading only  

    if((navigator.userAgent.match(/iPhone/i))  || (navigator.userAgent.match(/iPod/i)(navigator.userAgent.match(/iPad/i)))
{
       //LINK TO YOUR STYLESHEET
 }

Upvotes: 2

Related Questions