Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1472] Android: Vertical Layout Collapses To Empty

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:56:16.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsAndroid
Labelsandroid, defect
ReporterDon Thorp
AssigneeMarshall Culpepper
Created2011-04-15T02:53:45.000+0000
Updated2011-04-17T01:56:16.000+0000

Description

See http://developer.appcelerator.com/helpdesk/view/30521">Helpdesk 30521 for example. Basically in a Window, Labels added as children don't draw, collapse to zero, or some other issue. Side-effect is empty window.

Attachments

FileDateSize
screen_label.png2011-04-15T02:53:45.000+0000157826

Comments

  1. marco.schierhorn (at gmail) 2011-04-15

    Is there any new status on that ticket?
    Would really need to have this feature for horizontal layout.
    Im getting a list of values from a xml file of our client.
    So i dont really know the width/sizes of the lables im creating of this values and so i cant
    get a good horizontal scrolling bar at the top :-(

  2. Stephane 2011-04-15

    I'm having the same issue when setting vertical layout to a scrollview window is empty (scrollbar appears with the correct height) setting a layout to a view renders a correct view :

    var win = Titanium.UI.currentWindow;

    var scrollview = Titanium.UI.createScrollView({contentWidth:'auto',contentHeight:'auto',top:0,showVerticalScrollIndicator:true,showHorizontalScrollIndicator:true});
    var sview = Titanium.UI.createView({layout:'vertical',contentWidth:320,contentHeight:'auto'});

    var win_titre = Titanium.UI.createLabel({text:'TITLE', backgroundColor:'#09205F', width:'auto', height:'auto',font:{fontSize:14}, color:'#fff',top:0,left:0, visible:true});
    var win_description = Titanium.UI.createLabel({text:'MAIN LONG TEXT', height:'auto',width:'auto',font:{fontSize:12}, top:5,left:0});

    sview.add(win_titre);
    sview.add(win_description);

    scrollview.add(sview);
    win.add(scrollview);

  3. Stephane 2011-04-15

    I have just discovered that using

    var sview = Ti.UI.createView({width:'auto',height:'auto',top:0,layout:'vertical'});

    instead of

    var sview = Titanium.UI.createView({contentWidth:'auto',contentHeight:'auto',layout:'vertical'});

    make the whole view appear in the scrollView (cool)

  4. Don Thorp 2011-04-15

    (from [fae3442e85164bc616e31441fa5de28fb18e41fa]) [#987 state:fixed-in-qa][#1472 state:fixed-in-qa][#1856 state:fixed-in-qa][#863 state:fixed-in-qa] scroll view support vertical layout. Fixed other layout issues with scrollview. Note: #863 the KS test seems to have been changed to include top. I removed top and the label display as expected. http://github.com/appcelerator/titanium_mobile/commit/fae3442e85164bc616e31441fa5de28fb18e41fa"> http://github.com/appcelerator/titanium_mobile/commit/fae3442e85164...

  5. marco.schierhorn (at gmail) 2011-04-15

    Still not working for me with a horizontal layout
    All Lables are put on top of each other label.

         var scrollView = Titanium.UI.createScrollView(
         {
           contentWidth : 'auto',
           contentHeight : sc(44),
           left : 27,
           right : 27,
           height : 46,
           scrollType : 'horizontal',
           backgroundImage : '../assets/images/header-top-bg.gif'
         });
       
         var sView = Ti.UI.createView(
         {
           layout : 'horizontal',
           height : 'auto',
           width : 'auto'
         });
       
         for (i = 0; i < ressorts.length; i++)
         {
           titleUpperCase = ressorts[i].name.toUpperCase();
           var ressortColor = '#FFFFFF';
       
           if (i == 0)
           {
             ressortColor = '#CD2F26';
           }
       
           var l1 = Ti.UI.createLabel(
           {
             text : titleUpperCase,
             font :
             {
               fontSize : 13
             },
             color : ressortColor,
             width : 'auto',
             textAlign : 'left',
             height : sc(40),
             ressortBit : ressorts[i].bit,
             name : ressorts[i].name
           });
       
           l1.addEventListener('click', changeRessort);
           sView.add(l1);
          }
         scrollView.add(sView);
       
  6. Thomas Huelbert 2011-04-15

    1.4.2.4ce7ff G1 running 1.6, 2.2 simulator, using original provided code snippet.

    Marco, the code as provided won't run. If you still encounter the issue using todays pull, please log a new helpdesk ticket.

  7. hal 2011-04-15

    I'm sure the fix is fine - if it does not work, can't it simply be reopened?
    Bearing in mind that those people for whom this issue is particularly crucial are presumably watching this ticket, it would be a real flaw in the ticketing system if the issue was duplicated elsewhere, leaving everyone completely unaware.

  8. hal 2011-04-15

    OK, observing what happened after my previous post, it seems that the conversation can still continue in this ticket, and at least everyone receives an emailed update. If this is truly the case, then that will be fine.

JSON Source