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

Android: Size/Fill layout conflicts are not handled the same as iOS and Windows


    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 3.3.0
    • Fix Version/s: Release 6.2.0
    • Component/s: Android
    • Labels:
    • Sprint:
      2017 Sprint 17 SDK


      Android does not resolve a parent Ti.UI.SIZE and child Ti.UI.FILL conflict in the same manner as iOS and Windows Phone. The issue is that the parent wants to auto-size itself based on the child and the child wants to auto-size itself based on the parent. iOS and Windows resolves this by increasing the size of the child to fit the parent's parent. Android resolves this by shrinking the parent to just-fit the child's minimum size. Android should be changed to match iOS and Windows' behavior for portability.

      Titanium uses the Android MATCH_PARENT setting for Ti.UI.FILL. Unfortunately, the native Android behavior does not match iOS and Windows's behavior. Because of this, we cannot use this setting.

      Instead of using Ti.UI.FILL, you can use "100%" instead for vertical and composite layouts. However, this work-around will not work well in a horizontal layout if their are multiple views on the same row.

      Tests to reproduce:
      Please see the attached JavaScript files for testing:

      There are also attached screenshots for each test script above. The "Bad" screenshots show the buggy behavior on Android. The "Good" screenshots are the expected results.


        1. HorizontalFill-Bad.png
          71 kB
          Joshua Quick
        2. HorizontalFill-Good.png
          81 kB
          Joshua Quick
        3. HorizontalFillTest.js
          7 kB
          Joshua Quick
        4. HorizontalPinning-Bad.png
          108 kB
          Joshua Quick
        5. HorizontalPinning-Good.png
          108 kB
          Joshua Quick
        6. HorizontalPinningTest.js
          4 kB
          Joshua Quick
        7. ListViewFill-Bad.png
          23 kB
          Joshua Quick
        8. ListViewFill-Good.png
          28 kB
          Joshua Quick
        9. ListViewFillTest.js
          0.6 kB
          Joshua Quick
        10. SizeFillConflict-Bad.png
          22 kB
          Joshua Quick
        11. SizeFillConflict-Good.png
          25 kB
          Joshua Quick
        12. SizeFillConflictTest.js
          0.6 kB
          Joshua Quick
        13. VerticalFill-Bad.png
          24 kB
          Joshua Quick
        14. VerticalFill-Good.png
          28 kB
          Joshua Quick
        15. VerticalFillTest.js
          1 kB
          Joshua Quick

          Issue Links



              • Assignee:
                jquick Joshua Quick
                jquick Joshua Quick
                Gary Mathews
                Abir Mukherjee
              • Watchers:
                2 Start watching this issue


                • Created:

                  Backbone Issue Sync

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

                    Git Integration