Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-9994

Android: postlayout event not fired for labels

    Details

      Description

      On android no postlayout event is fired.
      On iOS, the postlayout event is fired once after adding the label to the window.
      If you change label properties, for example width, you can see that the properties are changed but no postlayout event is fired.
      The code snippet below is my simple testcase.

      app.js

      var win = Ti.UI.createWindow({
          backgroundColor : '#FFF',
          layout : 'vertical'
      });
       
      var label = Ti.UI.createLabel({
          text : "hello",
          left : 0,
          width : Ti.UI.SIZE,
          height : Ti.UI.SIZE
      });
       
      label.addEventListener("postlayout", function(e) {
          Ti.API.info("label postlayout");
          //alert("label post layout");
      });
       
      var doBtn = Ti.UI.createButton({
          title : "do",
          width : Ti.UI.SIZE,
          height : Ti.UI.SIZE
      });
       
      doBtn.addEventListener("click", function() {
          label.text = "new text";
          label.backgroundColor = '#F00';
          label.left += 20;
       
      });
      win.add(doBtn);
      win.add(label);
      win.open(); 
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ayeung Allen Yeung
                Reporter:
                psylo FabianS
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-5402
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration