Help(+Rep[Jiggy{HTML}])

Discussion in 'Jiggy Runtime Development' started by The Ax, Apr 23, 2008.

  1. The Ax

    The Ax Banned

    Joined:
    Mar 11, 2008
    Messages:
    647
    Likes Received:
    22
    How can I put HTML to display.
    I made my app to open a new .js file but i would like it to open an html file or maybe even txt file?

    +Rep and credit in app if you help at all
  2. OneFan

    OneFan Active Member

    Joined:
    Feb 25, 2008
    Messages:
    949
    Likes Received:
    67
    Device:
    iPhone 4 (White)
  3. The Ax

    The Ax Banned

    Joined:
    Mar 11, 2008
    Messages:
    647
    Likes Received:
    22
    WTF does that mean
  4. OneFan

    OneFan Active Member

    Joined:
    Feb 25, 2008
    Messages:
    949
    Likes Received:
    67
    Device:
    iPhone 4 (White)
  5. The Ax

    The Ax Banned

    Joined:
    Mar 11, 2008
    Messages:
    647
    Likes Received:
    22
    im looking for an example
  6. RazerM

    RazerM New Member

    Joined:
    Oct 4, 2007
    Messages:
    279
    Likes Received:
    5
    A UITextView control has a .HTML property, so you can use:
    Code:
    var text = new UITextView([0, 0, 320, 460]);//460 because status bar is 20
    text.HTML="This is <b>bold</b> and <i>italic</i>!";
    and add it as a subview etc to display it.
    1 person likes this.
  7. The Ax

    The Ax Banned

    Joined:
    Mar 11, 2008
    Messages:
    647
    Likes Received:
    22
    OMG THANKS...
    You Rock
    do you know how to go to next line
  8. RazerM

    RazerM New Member

    Joined:
    Oct 4, 2007
    Messages:
    279
    Likes Received:
    5
    use <br> within the string so this:
    Code:
    "Line 1<br>Line 2"
    is rendered as

    Code:
    Line 1
    Line 2
  9. The Ax

    The Ax Banned

    Joined:
    Mar 11, 2008
    Messages:
    647
    Likes Received:
    22
    You rock,
    is there anyway i can like load a file that is html?
  10. RazerM

    RazerM New Member

    Joined:
    Oct 4, 2007
    Messages:
    279
    Likes Received:
    5
    http://jiggyapp.com/doc/files2/Data-jsi.html

    The Data class allows you to load file contents, and change them to strings.

    To place the contents of a html file (located in your application directory) into a textview you could try this:
    Code:
    tempData = new Data();
    tempData.loadFromFile(Bundle.pathForResource("test_doc.html"));
    text.HTML=tempData.asString();
    Variables/files
    'text' is the UITextView
    'test_doc.html' must exist in your app folder.

    I'm not sure if images etc will be shown, as it is just a textview with HTMl interface for simple formatting. (Please do try and post back)

Share This Page