[TIMOB-11949] iOS: Label backgroundImage not set correctly on creation
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-04-08T08:17:07.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.3.0 |
Components | iOS |
Labels | module_label, qe-closed-3.3.0, qe-testadded |
Reporter | Martin Guillon |
Assignee | Vishal Duggal |
Created | 2012-11-03T14:08:12.000+0000 |
Updated | 2014-05-06T09:34:16.000+0000 |
Description
Following a [pull request](https://github.com/appcelerator/titanium_mobile/pull/2932) of mine, a regression appeared. Setting backgroundImage on creation was not working.
This is due to the fact that the layer was not created.
var win = Ti.UI.createWindow({backgroundColor:'white'});
var label = Ti.UI.createLabel({
width:100,
height:60,
top:50,
left:10,
text:'This is a test',
backgroundPaddingTop:20,
backgroundPaddingLeft:20,
backgroundPaddingRight:20,
backgroundImage:'KS_nav_UI.png'
})
win.add(label);
var b3 = Titanium.UI.createButton({
title:'animate',
height:40,
width:200,
bottom:10
});
var small = false;
b3.addEventListener('click', function()
{
if (!small)
label.animate({
width:140,
height:25,
top:10,
left:40
});
else
label.animate({
width:100,
height:60,
top:50,
left:10
});
small = !small;
});
win.add(b3);
win.open();
Now the label doesnt have a custom bgd layer. Instead it uses the TiUIView bgd layer.
And it overloads the method used to set the frame of the bgd layer to add padding
The example shows that setting the background image works on creation. But also that the new implementation didnt break padding, even with animations.
pull request https://github.com/appcelerator/titanium_mobile/pull/3376
Need to verify that this may already be fixed.
Cannot Reproduce with latest master with the test case from above. This could have fixed with the other view refactor that we had made in 3.3.0. Marking as Fixed.
Verified the issue: Appc-Studio:3.3.0.201405011408 sdk:3.3.0.v20140505115416 acs:1.0.14 alloy:1.4.0-dev npm:1.3.2 titanium:3.3.0-dev titanium-code-processor:1.1.1 xcode:5.1.1 Device:Ipod Touch1(7.0),Nexus7(v4.3) Label backgroundImage set properly while creation. Used the above mentioned code in description.