Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 5
Registered: ‎08-25-2012
My Device: Torch9810
My Carrier: Bell

Displaying paragraph of text

How can I display a paragraph of text in my app? from my main page I want user to click an image that will take them to another page and display some text.  I don't want to ue the TextArea as I don't want user input, simply want to display a paragraph of text under an image. 

Developer
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810
My Carrier: Verizon

Re: Displaying paragraph of text

If the text that you have dont change dynamically, i guess you can create an html file as an asset and load it using a webview.

 

WebView {
    id: webView
    url: "local:///assets/webview/javascriptmessage/test.html"
}

 The paragraph formatting can then be added within the html file.

 

- Dishooom

 

--------------------------------------------------------------------------------------------------------------------------------------------------------

Hope this helps... :Angel:

 

New Developer
Posts: 43
Registered: ‎01-14-2011
My Device: 9810, PlayBook
My Carrier: AT&T

Re: Displaying paragraph of text

Good idea, dishooom.  Although, oddly, my testing-so-far Cascades app seems fail to "run as..." if I add an HTML file into the /assets/ tree, even if I don't reference it...  :smileysad:

 

It does seem rather odd that this method should be necessary to display a paragraph or two of text.  :smileyfrustrated:

Developer
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: Displaying paragraph of text

You could set the TextArea to be not editable.

 

TextArea {
    editable: false
}

 Or you could just use a Label.

New Developer
Posts: 43
Registered: ‎01-14-2011
My Device: 9810, PlayBook
My Carrier: AT&T

Re: Displaying paragraph of text

That sorta works.  I also [belatedly] found the Label's multiline property, which when set to "True", yields a similar result.

Now to play with how to format the text within either of these.  HTML content works, but seems to get rendered a little weirdly...

:Wacko:

New Member
Posts: 1
Registered: ‎07-19-2013
My Device: Blackberry z10
My Carrier: Digi

Re: Displaying paragraph of text

Its help me =) Thanks!!