Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17827] Android: support for android:lines and android:maxLines

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2015-06-17T03:47:59.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsAndroid
LabelssupportTeam
ReporterMarco Cota
AssigneeAshraf Abu
Created2014-10-07T20:20:42.000+0000
Updated2017-03-16T21:53:58.000+0000

Description

Request

Currently on Titanium.UI.Label, there is no property to support max.Lines or number of lines similar to Android, customer would like to have this feature enabled. android:lines http://developer.android.com/reference/android/widget/TextView.html#attr_android:lines android:maxLines http://developer.android.com/reference/android/widget/TextView.html#attr_android:maxLines

Comments

  1. Manuel Lehner 2014-10-09

    PR: https://github.com/appcelerator/titanium_mobile/pull/6209 test code:
       var win = Ti.UI.createWindow({
         layout: 'vertical'
       });
       
       var label1 = Ti.UI.createLabel({
         top: 50,
         text: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
         width: 200,
         height: Ti.UI.SIZE,
         lines: 3
       });
       
       label1.addEventListener('singletap', function(){
         label1.setLines(1);
       });
       win.add(label1);
       
       var label2 = Ti.UI.createLabel({
         top: 50,
         text: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
         width: 200,
         height: Ti.UI.SIZE,
         maxLines: 3
       });
       
       label2.addEventListener('singletap', function(){
         label2.setMaxLines(1);
       });
       win.add(label2);
       
       win.open();
       
  2. Ingo Muschenetz 2014-11-17

    I believe the test code is slightly incorrect (note misspelling of "heigth")
  3. Manuel Lehner 2014-11-17

    @ingo Corrected it! (doesn't affect the result here)
  4. Ashraf Abu 2015-06-17

    Updated PR: https://github.com/appcelerator/titanium_mobile/pull/6917
  5. Lee Morris 2017-03-16

    Closing ticket as the issue has been fixed.

JSON Source