Label ellipsize not working on Android

You must Login before you can answer or comment on any questions.

Mobile Application

Titanium SDK: Titanium SDK version: 2.0.2 (05/30/12 10:21 2ff31a3)

Platform: iOS 5.1, Android 4.1 - Galaxy Nexus

Host OS: Mac OSX 10.8 Mountain Lion

Titanium Studio Version: Titanium Studio, build: 2.1.0.201206251749

I am trying to make my labels ellipsize on Android, it currently works on iOS but on android It does not, I have tried changing the ellipsize property in the label being used as well as trying label.ellipsize = true and label.setEllipsize(true) but still with no luck on Android

The label is put into a TableViewRow, I have set ellipsize true for this as well as the tableView and Window but still it does not seem to work

here is the code for my label any help would be much appreciated

var statusLabel = Ti.UI.createLabel({
                font:{fontSize:'13 dp'},
                wordwrap:false,
                ellipsize: true,
                left:'90 dp',
                top:'10 dp',
                right:'20 dp',
                height:'78 dp',
                color:'#222',
                verticalAlign: 'top',
                layout:'vertical',
 
                text:(!row.message ? 'No status message' : row.message)
 
            });

1 Answer

one possible thought is your dimensions might be being calculated weirdly? i have never seen a space before between the number and the 'dp' string. so use '90dp' rather then '90 dp'. This might do nothing as well.

verticalAlign is also only a mobileweb only property, does nothing in Android (or is undocumented/has weird results). Try removing that as well.

— answered 9 months ago by Paul Hamilton
answer permalink
3 Comments
  • another thought, a label does not need a layout property as it shouldn't have any children, remove layout as well

    — commented 9 months ago by Paul Hamilton

  • Thank you for the response, I have tried all of your suggestions but still the problem persists

    If there is any sample code of ellipsize working I would appreciate that as I have searched various places but have not found it

    — commented 9 months ago by Nitesh Lall

  • wordwrap should be wordWrap, try that next

    — commented 9 months ago by Paul Hamilton

Your Answer

Think you can help? Login to answer this question!