Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25201] iOS: tintColor doesn't work on imageView if dimensions (height, width) are provided

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-02-21T20:12:13.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.1.0
ComponentsiOS
LabelsimageView
ReporterILAY SENER
AssigneeVijay Singh
Created2017-08-28T08:09:17.000+0000
Updated2018-06-12T06:40:01.000+0000

Description

if height and width are provided, tintColor doesn't work on iOS for imageView. *Alloy*
<Alloy>
	<Window class="container" backgroundColor="orange">
		<View tintColor="blue" backgroundColor="green" height="100" layout="vertical">
			<ImageView  image="/images/ic_tv_white_48.png" tintColor="red" height="40" width="40" />
			<ImageView  image="/images/ic_tv_white_48.png" tintColor="red"  />
		</View>
	</Window>
</Alloy>
*Classic*
Ti.UI.backgroundColor = 'orange';
var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
	backgroundColor: 'green',
	height: 100,
	layout: 'vertical'
});

var image = Ti.UI.createImageView({
	image:'/ic_tv_white_48.png',
	tintColor: 'red',
	width: 40,
	height: 40
});

var image2 = Ti.UI.createImageView({
	image:'/ic_tv_white_48.png',
	tintColor: 'red'
});

view.add(image);
view.add(image2);
win.add(view);
win.open();

However, you can change the tintColor afterwards from js.

Attachments

FileDateSize
ic_tv_white_48_2x.png2017-08-28T08:07:53.000+0000326
ic_tv_white_48_3x.png2017-08-28T08:07:53.000+0000515
ic_tv_white_48.png2017-08-28T08:07:53.000+0000192

Comments

  1. Vijay Singh 2018-01-23

    PR : https://github.com/appcelerator/titanium_mobile/pull/9762 Note - Test case is mentioned in ticket.
  2. Samir Mohammed 2018-02-15

    Master is merged waiting for 7.1.0 Back-port [~vijaysingh]
  3. Vijay Singh 2018-02-21

    PR (7_1_X) : https://github.com/appcelerator/titanium_mobile/pull/9863
  4. Eric Wieber 2018-02-28

    Verified changes are included in SDK builds: 7.1.0.v20180227113527 & 7.2.0.v20180228075644

JSON Source