Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20538] Android: ImageView add margins if containing view width is not 100%

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.2.0
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterCREATIVE KAIZEN
AssigneeUnknown
Created2016-03-01T15:17:34.000+0000
Updated2018-02-28T19:55:27.000+0000

Description

Steps To Reproduce:

var window = Ti.UI.createWindow({
	backgroundColor: 'white'
});

	var lineContainer = Ti.UI.createView({
		width: '100%',  //set width to difference values, for example: 50%, 99%
		height: 20,
		backgroundColor:'red'
	});
	
		var line = Ti.UI.createImageView({
			image: '/images/linia_poziom.png',
			width: '100%'
		});
		
		lineContainer.add(line);
		
	window.add(lineContainer);

window.open();

Actual Results

If containingView width is set to other value than '100% percent then child ImageView adds space on left and right. Can be seen in attachments. Name corresponds to width value. I couldn't reproduce this error with 'http://www.appcelerator.com.s3.amazonaws.com/enterprisesurvey/images/appcelerator-logo.png', so I am sending my file (linia_poziom.png) for xxhdpi resource file to help to track this bug.

Attachments

FileDateSize
100%.png2016-03-01T15:14:20.000+00002575
50%.png2016-03-01T15:14:20.000+00003437
99%.png2016-03-01T15:14:20.000+00003487
linia_poziom.png2016-03-01T15:16:44.000+0000326

Comments

  1. Sharif AbuDarda 2016-03-01

    Hello, I tried to test your code. I used your linia_poziom.png as line image. Here is the observation I got. I tested with SDK 5.2.0.GA. 1. When lineContainer width is 100%, line image looks to be getting stretched and takes the full width. 2. When lineContainer width is 50%, line image looks to be thinner and leaves spaces on left and right. 3. When lineContainer width is 40%, line image takes the full width. 4. When lineContainer width is 30%, line image is not visible. Thanks.
  2. CREATIVE KAIZEN 2016-04-25

    Hello, This issue not only depends on the width property set by user, but also on width of the device. On some device (1920x1080 it may look ok, but on 480x320 it may take just half of the device screen). Thanks.

JSON Source