Revision history [back]

click to hide/show revision 1
initial version

answered 2015-10-08 14:08:11 +0800

chillworld gravatar image chillworld flag of Belgium

https://github.com/chillw...

Hey Bobtedbob,

There is no way to set different style within 1 label.

There are 3 solutions what you can do.

First solution:

As Darksu already mentioned, you can use a hlayout where you put children attribute for the children and so dynamicly construct different labels with there styles.

Second solution :

Use ckeditor in stead of label. ckeditor is a textbox who supports html(and create html output when you type). The problem here is it's not a label.

Thirth solution:

Use htmlNativeComponent.
This is possible when your text in controller or viewmodel is already html with the colors.

Example use :

Hlayout parent; // this must be wired in controller or use @selectorParam in viewmodel 
HtmlNativeComponent n = new HtmlNativeComponent("html", myString, "");
parent.getChildren().clear();
parent.appendChild(n);

Greetz chill.

Hey Bobtedbob,

There is no way to set different style within 1 label.

There are 3 solutions what you can do.

First solution:

As Darksu already mentioned, you can use a hlayout where you put children attribute for the children and so dynamicly construct different labels with there styles.

Second solution :

Use ckeditor in stead of label. ckeditor is a textbox who supports html(and create html output when you type). The problem here is it's not a label.

Thirth solution:

Use htmlNativeComponent.
This is possible when your text in controller or viewmodel is already html style with the colors.

Example use :

Hlayout parent; // this must be wired in controller or use @selectorParam in viewmodel 
HtmlNativeComponent n = new HtmlNativeComponent("html", myString, "");
parent.getChildren().clear();
parent.appendChild(n);

Greetz chill.

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More