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

Bug with Ti.UI.SIZE for view height on android

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 6.2.0
    • Component/s: Android
    • Environment:

      sdk: 3.3.0
      platform: android

    • Story Points:
      8
    • Sprint:
      2017 Sprint 17 SDK

      Description

      height for view on android calculating wrong and different then on iOS
      this happens if layout set to 'horizontal' and child views have width set to Ti.UI.FILL

      ~~~
      var win = Ti.UI.createWindow(

      { backgroundColor : '#fff' }

      );

      var font =

      { fontSize : '14dp' }

      ;

      var View = Ti.UI.createView(

      { height : Ti.UI.SIZE, borderColor : '#666', borderWidth : '1dp', left : '10dp', right : '10dp', top : '50dp', layout : 'horizontal', backgroundColor : '#dfd' }

      );

      var toLabel = Ti.UI.createLabel(

      { left : '5dp', top : '5dp', text : 'To:', width : Ti.UI.SIZE, font : font, backgroundColor : '#dfa' }

      );
      var toCardLabel = Ti.UI.createLabel(

      { top : '5dp', right : '5dp', text : '123456789\n($456)', width : Ti.UI.FILL, textAlign : 'right', font : font, color : '#666', backgroundColor : '#bfd' }

      );

      var fromLabel = Ti.UI.createLabel(

      { left : '5dp', top : '5dp', text : 'From:', width : Ti.UI.SIZE, font : font, backgroundColor : '#bdd' }

      );
      var fromCardLabel = Ti.UI.createLabel(

      { top : '5dp', right : '5dp', text : '123456789\n($456)', width : Ti.UI.FILL, textAlign : 'right', font : font, color : '#666', backgroundColor : '#ee9' }

      );

      var amountLabel = Ti.UI.createLabel(

      { left : '5dp', top : '5dp', bottom : '5dp', height : Ti.UI.SIZE, text : 'Amount to transfer:', width : Ti.UI.SIZE, font : font, backgroundColor : '#ee6' }

      );
      var amountField = Ti.UI.createLabel(

      { top : '5dp', right : '5dp', text : '$1245', width : Ti.UI.FILL, textAlign : 'right', color : '#393', font : font, backgroundColor : '#cdb' }

      );

      win.add(View);

      View.add(toLabel);
      View.add(toCardLabel);

      View.add(fromLabel);
      View.add(fromCardLabel);

      View.add(amountLabel);
      View.add(amountField);

      win.open();
      ~~~

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                rian Andrey Pervushin
                Tester:
                Abir Mukherjee
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code