I have a common css file and some dynamic html text. What I'm trying to do is load the css file from disk and use dynamic HTML text to display in the UIWebView instead of putting the same css again in the text with html text.
I try so.
var sometext = "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"></head>" + "<body><p>some text goes here</p></body></html>" let mainbundle = NSBundle.mainBundle().bundlePath let bundleURL = NSURL(fileURLWithPath: mainbundle) self.webview.loadHTMLString(sometext, baseURL: bundleURL)
Now the css problem does not apply to html. Is there anyone there who can help, I think I'm stuck.
Please, help. Thanks!
source share