公告
财富商城
积分规则
提问
发文
2019-05-23 02:11发布
The star\"
How to open url in textview iphone??
Is it possible to show data with links,photos and all html entities???
links
photos
html entities
It's not possible with UITextView control. Use UIWebView or make your own custom control.
UITextView
UIWebView
You can use UIWebView to load a static contain from files; html, photo, css, javascript.
NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; NSString *filePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]; NSString *htmlString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]; [self.webView loadHTMLString:htmlString baseURL:baseURL];
then just add "index.html" as normal HTML standard to your project.
<html> <head><title>Hello</title></head> <body> <img src="icon.png"/> <p>Test</p> </body> </html>
最多设置5个标签!
It's not possible with
UITextView
control. UseUIWebView
or make your own custom control.You can use UIWebView to load a static contain from files; html, photo, css, javascript.
then just add "index.html" as normal HTML standard to your project.