Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26679] iOS: Label property ellipsize = TEXT_ELLIPSIZE_TRUNCATE_CHAR_WRAP not adding ellipses

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 7.5.1
Fix Version/sn/a
Componentsn/a
LabelsengSchedule, ios
ReporterEmily Feder
AssigneeShak Hossain
Created2018-12-12T17:23:42.000+0000
Updated2019-03-26T15:36:53.000+0000

Description

From the documentation [here](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Label-property-ellipsize), I thought that setting the label's ellipsize property to TEXT_ELLIPSIZE_TRUNCATE_CHAR_WRAP should add an ellipses at the end of the truncated text, but it's just truncating the text without adding the ellipses. *Workaround* The default ellipsize setting (TEXT_ELLIPSIZE_TRUNCATE_END) does add ellipses. So not sure what the intended difference between TEXT_ELLIPSIZE_TRUNCATE_CHAR_WRAP and TEXT_ELLIPSIZE_TRUNCATE_END is. *Sample App* Create a sample classic titanium app and put this code in your app.js:
var win = Ti.UI.createWindow();

// Expected: Only show 1 line with ellipses at the end
// Actual: Only shows 1 line truncated text, but no ellipses
var label_char_setting = Ti.UI.createLabel({
    text: 'This is a long label that should not wrap and instead ellipsize after last fitting character',
    width: 200,
    top: '35%',
    ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_CHAR_WRAP,
    wordWrap: false,
    font: {
        fontSize: 16
    },
    maxLines: 1
});

// Expected: Only show 1 line with ellipses at the end
// Actual: As expected
var label_default_setting = Ti.UI.createLabel({
    text: 'This is a long label that should not wrap and instead ellipsize after last fitting character',
    width: 200,
    top: '50%',
    ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END,
    wordWrap: false,
    font: {
        fontSize: 16
    },
    maxLines: 1
});

win.add([label_char_setting, label_default_setting]);

win.open();

// added during app creation. this will automatically login to
// ACS for your application and then fire an event (see below)
// when connected or errored. if you do not use ACS in your
// application as a client, you should remove this block
(function(){
var ACS = require('ti.cloud'),
    env = Ti.App.deployType.toLowerCase() === 'production' ? 'production' : 'development',
    username = Ti.App.Properties.getString('acs-username-'+env),
    password = Ti.App.Properties.getString('acs-password-'+env);

// if not configured, just return
if (!env || !username || !password) { return; }
/**
 * Appcelerator Cloud (ACS) Admin User Login Logic
 *
 * fires login.success with the user as argument on success
 * fires login.failed with the result as argument on error
 */
ACS.Users.login({
    login:username,
    password:password,
}, function(result){
    if (env==='development') {
        Ti.API.info('ACS Login Results for environment '+env+':');
        Ti.API.info(result);
    }
    if (result && result.success && result.users && result.users.length){
        Ti.App.fireEvent('login.success',result.users[0],env);
    } else {
        Ti.App.fireEvent('login.failed',result,env);
    }
});

})();
*Result* !Screen Shot 2018-12-12 at 11.11.12 AM.png|thumbnail!

Attachments

FileDateSize
Screen Shot 2018-12-12 at 11.11.12 AM.png2018-12-12T17:22:38.000+000023953

Comments

  1. Rakhi Mitro 2018-12-13

    Hello, Thanks for reporting this issue. Can you please test this on SDK 7.5.0.GA and let us know how it goes.
  2. Emily Feder 2018-12-18

    I tried with sdk 7.5.0.GA but saw no difference.

JSON Source