Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13331] Android: Sometimes imageView doesn't occupy all of parent view when there is more than one imageView in the window

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.0.2, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterSam Cleaver
AssigneeUnknown
Created2012-10-17T13:58:32.000+0000
Updated2018-02-28T20:03:56.000+0000

Description

If there is more than one imageView in a window and both are set to height 100%. Sometimes they will not occupy 100% of their respective parent views. *Workarounds:* Use a webview (hit on performance) *Reproducibility:* 9 / 10 (its either one or the other or both not occupying 100% height) *Annoyability:* 10 / 10 *Test Code:*
var win = Titanium.UI.createWindow({
	title : 'Tab 1',
	backgroundColor : 'green'
});

//Either one of these boxes will not render correctly
var topbox = Ti.UI.createView({
	/* left & right work too */
	top : '1%',
	height : '32%',
	width : '100%',
	backgroundColor : 'black'
});

var topimage = Ti.UI.createImageView({
	image : 'http://beaver6813.com/dev/jira/codestrong-2.jpg',
	width : '100%',
	height : '100%',
	top : 0,
	left : 0
});

var botbox = Ti.UI.createView({
	/* left & right work too */
	bottom : '1%',
	height : '32%',
	width : '100%',
	backgroundColor : 'black'
});

var botimage = Ti.UI.createImageView({
	image : 'http://beaver6813.com/dev/jira/codestrong-2.jpg',
	width : '100%',
	height : '100%',
	top : 0,
	left : 0
});

botbox.add(botimage);
win.add(botbox);
topbox.add(topimage);
win.add(topbox);

win.open();

Attachments

FileDateSize
device-2012-10-17-145817.png2012-10-17T13:58:32.000+0000401916

Comments

  1. Daniel Sefton 2013-04-02

    Reproduced with Ti SDK 3.0.2 GA, Samsung Galaxy S3 Android 4.0.4 Bug doesn't occur with Samsung Galaxy S2 Android 2.3.6, so it's a device-specific issue.
  2. jithinpv 2013-04-22

    Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Android Emulator: Android SDK version: 2.2

JSON Source