Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23648] Android: Layout engine does not work well as expected on iOS

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2016-07-20T09:37:31.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterShuo Liang
AssigneeHans Knöchel
Created2016-07-18T02:32:02.000+0000
Updated2016-07-20T09:37:31.000+0000

Description

Reproduce Step:

1. Run the following code in a classic project.
var tourWindow = Ti.UI.createWindow({});
												
	var contain0 = Ti.UI.createView({
		width:'80%',
		height:Ti.UI.SIZE,
		layout:'vertical'
	});
	
	var hdrWelcome = Ti.UI.createImageView({
		image:'hdr-welcome.png'
	});
	
	var btnGroup = Ti.UI.createView({
		width:Ti.UI.FILL,
		height:Ti.UI.SIZE,
		borderColor:'yellow'
	});
	
	var quickTourBtn = Ti.UI.createButton({
		title:'quick tour',top:20,left:0,width:'50%',height:50,color:'white',textAlign:'center'
	});
	var skipBtn = Ti.UI.createButton({
		title:'skip',top:20,right:0,width:'50%',height:50,color:'white',textAlign:'center'
	});	
	
	btnGroup.add(quickTourBtn,skipBtn);
	contain0.add(hdrWelcome,btnGroup);
	tourWindow.add(contain0);
	tourWindow.open();

Problem.

1. Run on iOS, it works well as expected (attached screen shot). 2. Run on Android, it does not work well as expected (attached screen shot).

Attachments

FileDateSize
hdr-welcome.png2016-07-18T02:37:16.000+00002358
Not expected on Android.png2016-07-18T02:36:54.000+000029799
work well in iOS.PNG2016-07-18T02:36:54.000+000062320

Comments

  1. Hans Knöchel 2016-07-20

    Closing as invalid, after [~sliang] confirmed that the provided solution is the proper way to go here.

JSON Source