[TIMOB-26679] iOS: Label property ellipsize = TEXT_ELLIPSIZE_TRUNCATE_CHAR_WRAP not adding ellipses
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 7.5.1 |
Fix Version/s | n/a |
Components | n/a |
Labels | engSchedule, ios |
Reporter | Emily Feder |
Assignee | Shak Hossain |
Created | 2018-12-12T17:23:42.000+0000 |
Updated | 2019-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
File | Date | Size |
---|---|---|
Screen Shot 2018-12-12 at 11.11.12 AM.png | 2018-12-12T17:22:38.000+0000 | 23953 |
Hello, Thanks for reporting this issue. Can you please test this on SDK 7.5.0.GA and let us know how it goes.
I tried with sdk 7.5.0.GA but saw no difference.