[TIMOB-11586] iOS: Using the backgroundGradient property changes the order in which views are added
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-11-16T19:02:35.000+0000 |
Affected Version/s | Release 2.1.3 |
Fix Version/s | Release 3.1.0, 2012 Sprint 23 API, 2012 Sprint 23 |
Components | iOS |
Labels | Parity, api, module_view, qe-testadded |
Reporter | Nikhil Sharma |
Assignee | Vishal Duggal |
Created | 2012-10-26T21:38:47.000+0000 |
Updated | 2014-04-23T14:20:52.000+0000 |
Description
Using backgroundGradient property to a view changes the order in which the views are added to it. It works fine on android. Please find attached screenshot with and without the backgroundGradient property.
Repo Steps
1. Run the below code in your project's app.js 2. You can see that the green view is behind the red view. The order of the views changes after adding the backgroundGradient property.
var win1 = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff'
});
var g_backgroundGradient = {startPoint: {x:0, y:0}, endPoint: {x:400, y:600}, colors:['blue', 'orange'], type: 'linear'};
var backview = Titanium.UI.createView({
backgroundGradient : g_backgroundGradient // <<< COMMENT OUT THIS LINE TO FIX PROBLEM
});
var view1 = Titanium.UI.createView({
backgroundColor : 'red',
width : '300',
height : '400',
left : 15,
top : 15,
zindex : 10,
});
var view2 = Titanium.UI.createView({
width : '100',
height : '70',
left : 5,
top : 5,
backgroundColor : 'green',
zindex : 1
});
backview.add(view1);
backview.add(view2);
win1.add(backview);
win1.open();
Attachments
File | Date | Size |
---|---|---|
with_backgroundGradient.png | 2012-10-26T21:38:47.000+0000 | 90559 |
without_backgroundGradient.png | 2012-10-26T21:38:47.000+0000 | 77466 |
Pull pending https://github.com/appcelerator/titanium_mobile/pull/3357
Views displayed in correct order. Verified on: Studio: 3.0.1.201212181159 SDK: 3.1.0.v20130114171802 iOS Device: iPhone Simulator (v6.0), iPhone4S (v5.1), iPhone5 (v6.0) XCode: 4.5.2