2

In Kony Studio 6.5 I have a label in a form. In this label I have an i18n localized string. For formatting purposes, I want to add a space after the string. So far I've tried placing a space after the i18n key itself to no avail. I have also tried setting the label text in the form preShow() like so:

frmExample.lblSample.text = kony.i18n.getLocalizedString("my_i18n_key") + ' ';

I have also tried using unicode spaces and non-breaking spaces in the above code snippet, but all to no avail. Is there any way I can stop the label from automatically removing the trailing whitespaces?

Ted Jani
  • 51
  • 3
  • You need to use the CSS white-space property : http://www.w3schools.com/cssref/pr_text_white-space.asp with "pre" or "pre-wrap". That prevents the collapsing of white spaces. – Danmoreng Oct 30 '15 at 13:26
  • I'm not able to use CSS formatting for the native label skins in Kony. – Ted Jani Oct 30 '15 at 14:13
  • The white-space is a css property, you either have to overrite the given CSS class or add the style afterwards with Javascript to your label. – Danmoreng Oct 30 '15 at 14:22

1 Answers1

3

use \xa0 in a string it is the character representing the HTML entity   it won't get trimmed.

shiroYasha
  • 31
  • 6