Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

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

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-12-06T00:32:03.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2013 Sprint 25, 2013 Sprint 25 API, Release 3.2.0, Release 3.3.0
ComponentsAndroid
Labelsmodule_window, qe-testadded, triage
ReporterTony Lukasavage
AssigneePing Wang
Created2013-12-05T20:58:44.000+0000
Updated2014-07-29T17:52:38.000+0000

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.

Comments

  1. Ingo Muschenetz 2013-12-05

    can you please investigate?
  2. Ping Wang 2013-12-05

    PR: https://github.com/appcelerator/titanium_mobile/pull/5069
  3. Ping Wang 2013-12-05

    3.2.X PR: https://github.com/appcelerator/titanium_mobile/pull/5072
  4. Neha Mittal 2013-12-11

    Verified with Environment: Appcelerator Studio: 3.2.0.201312101708 SDK: 3.2.0.v20131210191510 alloy: 1.3.0-cr acs: 1.0.10 npm: 1.3.2 titanium: 3.2.0-cr titanium-code-processor: 1.1.0-cr Device: Nexus 7(v4.2.1)/Mac 9 It works as expected. Hence closing the issue.

JSON Source