我得到了 html 的这个值,所以如果我得到这种类型的值,如何在 webview 中显示 <head> <meta/> <title>Journey Mapper - Getting Started</title> </head> <body> <a name="top"><h3>Getting Started - Registration and Login</h3></a> <p class="style1"> <a href="Index.html">Home</a> <a href="#reg">Registration</a> <a href="#login">Login</a> <a href="#forget">Forgot Password</a> </p> <a name="reg"><h4>Regis<a href="#top" class="style1" style="text-align:right"></a></h4> </a> <p>When the application starts in a click on "My Journeys" tab</p> <p>Click on "New User" button </p> <p>A Registration form will popup enter your profile details</p> <p>Note: </p> <ul> <li>All fields are mandatory</li> <li>A password must be at least eight characters long, begin with an alphabetic character, contain at least one upper case and one lower case letter, at least one number and one of the following special characters</li> <li>A valid email address should be provided to facilitate password reset</li> <li>Active Internet connection is required to setup your profile</li> </ul> <p>Click on sign up button to complete your registration</p> <p><a name="reg" id="reg"><a href="#top" class="style1" style="text-align:right">Back to Top</a></a></p> <a name="login"><h4>Login</h4></a> <p>To login as a registered user to Journey Mapper, click on "My Journey" tab </p> <p>Click on "Login" button</p> <p>A dialog will pop up, enter your registered username and password in respective fields.</p> <p>Click on login button to validate provided credentials and to log you in.</p> <p>You can also check "Auto-login" to retain your login information even when application is closed.</p> <p><a name="reg" id="reg2"><a href="#top" class="style1" style="text-align:right">Back to Top</a></a></p> <a name="forget"><h4>Forgot Password</h4></a> <p>In case you have forgotten your password you can request a reset of your password.</p> <p>Click on the "Forgot Password?" link on the login dialog.</p> <p>A "Forgot Password?" form will appear, enter your username and click on the "Send Password" button</p> <p>An email will be sent to your registered email address, which will contain the instructions to reset your password</p> <p><a name="reg" id="reg3"><a href="#top" class="style1" style="text-align:right">Back to Top</a></a></p> <p><a name="jump" href="#">Continue reading</a></p> </body> </html>
问问题
274 次
2 回答
0
这应该可以帮助你
NSString *myHTML = @"<html><body><h1>Hello, world!</h1></body></html>"; [myUIWebView loadHTMLString:myHTML baseURL:nil];
如果您有任何图像,baseURL 将是您的资源文件夹的 fileURL,或者您可以通过nil
.
于 2012-07-23T10:50:33.203 回答
0
对网页视图使用加载字符串方法:
[webView loadHTMLString:myHtmlString baseURL:nil];
于 2012-07-23T11:48:57.157 回答