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

Android: Views using Ti.UI.FILL don't layout correctly when containing Window has implicit height/width

    Details

      Description

      problem

      It seems that as of TiSDK 3.2.0, when containing Windows mix implicit with explicit definitions of height and width that the views inside of it do not layout properly when they attempt to use Ti.UI.FILL. Since this is a hard one to explain clearly, it's best to look at the very simple test case below. With that test case as is, you will just see a black screen on Android (tested on 4.2.2), which is not expected. If you comment out the height:Ti.UI.FILL, it shows the red view covering the screen, which is the expected behavior.

      There are likely many permutations of this issue that can affect layouts, but this is the simplest test case I created to surface the issue.

      test case

      var win = Ti.UI.createWindow({
      	backgroundColor: '#fff',
      	
      	// comment out height here and the view shows up fine
      	height: Ti.UI.FILL
      });
       
      win.add(Ti.UI.createView({
      	backgroundColor: '#a00',
      	height: Ti.UI.FILL,
      	width: Ti.UI.FILL
      }));
       
      win.open();
      

      expected

      Views within a Ti.UI.Window on Android should be able to use Ti.UI.FILL to set there height and width regardless of whether or not height and width are explicitly set in the containing Window, since height and width should be Ti.UI.FILL by default for Windows.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pwang Ping Wang
                Reporter:
                tlukasavage Tony Lukasavage
                Reviewer:
                Hieu Pham
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code