01-27-2013 04:27 PM - edited 01-27-2013 04:35 PM
If you're not already aware, you can use HTML inside of your Cascades Labels. This lets you do cool things like apply CSS styling to your text. It also lets you incorporate links directly into your app, quickly and easily.
If you're adding links, you'll want to use <a></a> tag to link to the external content you want to. You'll notice that the links will be styled blue, bolded, and underlined by default.
If you want to change the default styling of links, you'll have to do the following:
<a style="color: #ff0000; text-decoration: none;" href="http://developer.blackberry.com/">Link to BlackBerry Developer</a>
Notice how I've incorporated CSS styling directly in the HTML tag. Furthermore, notice how I've placed it before the href parameter. This is important!
There's seemingly a bug/quirk with the HTML parsing where if you put anything after the href parameter, it gets blended into the URL that's invoked. This means that the following code:
<a href="http://developer.blackberry.com/" style="color: #ff0000; text-decoration: none;">Link to BlackBerry Developer</a>
Hopefully this saves some of you some headache. I'll file a bug report with RIM about this as well.
Edit: JCarty just informed me that apparently shortcodes for colours don't work either (i.e. #eee vs #eeeeee). So stick with full hex color codes, named colors, or rgb values.
Edit2: Link to the relevant documentation, courtesy of peter9477: https://developer.blackberry.com/cascades/document
09-02-2014 06:58 AM
Either that or have a listener somehow on any link click in the HTML text in the label, and determining what to do based on the URL/text of the link?
09-02-2014 03:11 PM
Extract from documentation: