0

Formatting xml text on sidebar

Hi everyone,

How can I format a xml item nicely on a sidebar view. Because currently the text which I want to display is too long, and it gets out of the sidebar. Something like the image below.



Thanks.

by
6 Replies
  • 0
  • You need to set the "styles" value "wrap: true'
    0
  • QUOTE (WidgetRealm @ Jan 17 2011, 07:37 AM) <{POST_SNAPBACK}>
    You need to set the "styles" value "wrap: true'


    Noted, it works. Thanks.
    0
  • Hi WidgetRealm,

    I tried the same method, but my text inside grid cell is not wrapping. My XML data is coming dynamically. Is this the reason it is creating the problem?

    Here is the code :
    CODE
    cell.textLabel = new KONtx.element.Text({
    styles: {
    color: '#FFFFFF',
    fontSize: KONtx.utility.scale(18),
    hAlign: 'left',
    vAlign: 'left',
    wrap: true
    }
    }).appendTo(cell);
    return cell;
    0
  • QUOTE (sharmeela @ Jun 1 2011, 10:03 PM) <{POST_SNAPBACK}>
    Hi WidgetRealm,

    I tried the same method, but my text inside grid cell is not wrapping. My XML data is coming dynamically. Is this the reason it is creating the problem?

    Here is the code :
    CODE
    cell.textLabel = new KONtx.element.Text({
    styles: {
    color: '#FFFFFF',
    fontSize: KONtx.utility.scale(18),
    hAlign: 'left',
    vAlign: 'left',
    wrap: true
    }
    }).appendTo(cell);
    return cell;



    You'll need to set the width property inside styles. vAlign can be set to 'top', 'center', or 'bottom'.

    CODE
    cell.textLabel = new KONtx.element.Text({
    styles: {
    color: '#FFFFFF',
    fontSize: KONtx.utility.scale(18),
    hAlign: 'left',
    vAlign: 'center',
    width: this.width,
    wrap: true
    }
    }).appendTo(cell);
    return cell;


    I hope that helps.
    0
  • CODE
    cell.textLabel = new KONtx.element.Text({
    styles: {
    color: '#FFFFFF',
    fontSize: KONtx.utility.scale(18),
    hAlign: 'left',
    vAlign: 'center',
    width: this.width,
    wrap: true
    }
    }).appendTo(cell);
    return cell;
    0

Recent Posts

in Design / Interaction - Yahoo! TV Widgets