[TIMOB-13330] Android: borderRadius on outer view can cause a jpeg to render incorrectly inside
| GitHub Issue | n/a | 
|---|---|
| Type | Bug | 
| Priority | Low | 
| Status | Closed | 
| Resolution | Cannot Reproduce | 
| Resolution Date | 2017-07-05T21:22:05.000+0000 | 
| Affected Version/s | Release 3.0.2 | 
| Fix Version/s | n/a | 
| Components | Android | 
| Labels | n/a | 
| Reporter | Sam Cleaver | 
| Assignee | Eric Merriman | 
| Created | 2012-10-17T13:48:26.000+0000 | 
| Updated | 2017-07-05T21:22:05.000+0000 | 
Description
	If a JPEG imageView with opacity set to anything but 1 is put inside another view with borderRadius set, it can sometimes cause the transluscent imageView to display content below it that you should not see (layers).
Note: This does not seem to affect PNG or GIF for some reason. 
*Workarounds:* Switch to PNG/GIF image formats, or set opacity of the image to 1, or remove borderRadius from the parent view.
*Reproducibility:* 1 / 10 (though always on first run after load, perhaps cache?)
*Annoyability:* 9 / 10 (Its exactly these kind of fiddly bugs that wastes so much of my time debugging/developing on Titanium.)
*Test Code:*
var win = Titanium.UI.createWindow({
	title : 'Tab 1',
	backgroundColor : 'green'
});
//This top box/image will not display correctly and will show the green below
//despite topbox having full opacity and background color set to black.
var topbox = Ti.UI.createView({
	/* left & right work too */
	top : '1%',
	height : '32%',
	width : '100%',
	backgroundColor : 'black',
	borderRadius : 10
});
var topimage = Ti.UI.createImageView({
	image : 'http://beaver6813.com/dev/jira/codestrong-2.jpg',
	width : '100%',
	height : '100%',
	top : 0,
	left : 0,
	zIndex : 1,
	opacity : 0.5
});
//Despite having exactly the same settings as the box above, this image will
//display correctly because its not a jpeg.
var botbox = Ti.UI.createView({
	/* left & right work too */
	bottom : '1%',
	height : '32%',
	width : '100%',
	backgroundColor : 'black',
	borderRadius : 10
});
var botimage = Ti.UI.createImageView({
	image : 'http://beaver6813.com/dev/jira/codestrong-2.png',
	width : '100%',
	height : '100%',
	top : 0,
	left : 0,
	zIndex : 1,
	opacity : 0.5
});
botbox.add(botimage);
win.add(botbox);
topbox.add(topimage);
win.add(topbox);
win.open();
Attachments
| File | Date | Size | 
|---|---|---|
| device-2012-10-17-143627.png | 2012-10-17T13:48:26.000+0000 | 259143 | 
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.
I am unable to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131