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

Android: Ti.UI.FILL stretches parent views beyond absolutely-sized parent

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 3.1.2
    • Fix Version/s: Release 6.2.0
    • Component/s: Android
    • Labels:
    • Environment:

      SDK 3.1.1.GA
      Samsung Galaxy S2, Android 4.1.2

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

      Description

      The following code has a different result on Android then expected and correctly shown on iOS. Compare the two screenshots and see that while the blue v3 view correctly fills the height of its fixed-sized green v2 view, it causes the red v1 view to fill to its parent instead of size to its child.

      Code to reproduce

      var win = Ti.UI.createWindow({backgroundColor:'white'});
      var v1 = Ti.UI.createView({backgroundColor:'red', width: 100, height: Ti.UI.SIZE});
      var v2 = Ti.UI.createView({backgroundColor:'green', width: 100, height: 100});
      var v3 = Ti.UI.createView({backgroundColor:'blue', width: 100, height: Ti.UI.FILL});
      v2.add(v3);
      v1.add(v2);
      win.add(v1);
      win.open();
      

      Workaround

      On line 4, replace Ti.UI.FILL by '100%' and it will work as expected in most cases. The difference is that if in the exampel above you would set v3.top: 50 and height: '100%' then the height will be 100 and not 50 as with Ti.UI.FILL!

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                fokkezb Fokke Zandbergen
                Tester:
                Abir Mukherjee
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code