简体   繁体   中英

Field 'isTextEllipsized' from Label component not working - Roku Scenegraph

As I said on the title the field isTextEllipsized is not working for me, is always returning false.

Example:

label = m.top.createChild("Label")
label.color = "#ffffff"
label.font = font
label.vertAlign = "bottom"
label.wrap = true
label.lineSpacing = 2
label.width = 135
label.height = 61
label.text = "Really really really really really really long long long long long text"

? "label.isTextEllipsized " label.isTextEllipsized

Console prints:

label.isTextEllipsized false

Note: Using Roku 4210x - OS 7.2

Has the label been rendered on screen yet? Ie has SG had a chance to set isTextEllipsized.

If so, it might be a bug, see http://forums.roku.com/viewtopic.php?f=34&t=94601

also, might be that because you set color incorrectly:

"#ffffff" should be "0xFFFFFFFF"

Just an outside guess, but because it's a string, it might accept it, but silently cause the component to fail.

Please add the below code to solve this issue

label.ellipsizeOnBoundary = "true"

I know that this may not help you but I'm adding for future referrers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM