Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8433] iOS: Ti.UI.ImageView does not follow explicit sizing

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-04-17T10:14:52.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sRelease 3.0.2
ComponentsiOS
Labelsn/a
ReporterStephen Tramer
AssigneeShameer Jan
Created2012-03-29T17:12:45.000+0000
Updated2017-03-17T18:35:03.000+0000

Description

Currently, iOS image views do not obey explicit sizing instructions for percentage measurements (and possibly others). For example, when we have an image of 300 x 419 at "50%" embedded in a parent view of 200, we do not see the behavior of the image view which would be expected (it measures 100 x 100, with image stretching).
var win = Ti.UI.createWindow();

var parent = Ti.UI.createView({
	width:200,
	height:200,
	backgroundColor:'red'
});
var child = Ti.UI.createView({
	width:"50%",
	height:"50%",
	backgroundColor:'blue'
});
var image = Ti.UI.createImageView({
	width:"50%",
	height:"50%",
	image:'images/corkboard.jpg'
});

parent.add(child);
parent.add(image);
win.add(parent);
win.open();

Pass

---- The blue view should not be visible, since it has the same dimensions as the image view, which should overlay it.

Comments

  1. Shameer Jan 2013-04-17

    issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
  2. Lee Morris 2017-03-17

    Closing ticket as the issue cannot be reproduced.

JSON Source