views:

26

answers:

1

Hi friends,

I have to show html string in textview not in uiwebview. Because i have to edit the content of the html string.

for ex:

NSString *data="< br>Data to be shown<\ br>"

textview.text= data;

Is it possible? Thanks in advance for suggestion

Regards, sathish

A: 

I'm not sure what UIWebView is, but yes, it's possible. You need only read the HTML into a string variable and write that string into the Text property of your control.

In VB (my apologies, I'm not sure what language you're using), this is how I'd do it:

Imports System.IO

Dim file As String = "MyWebPage.html"
Dim tr As TextReader = File.OpenText(file)

' You can even skip reading the HTML into a string variable...
TextBox1.Text = tr.ReadToEnd
tr.Close

TextBox1 is a multiline textbox where the HTML code for MyWebPage.html will be displayed.

HTH

Logan Young