Problem Description
In 3.3.0.GA all labels disappears when I do toImage() on their container view. This worked perfectly fine in all versions before 3.3.0.GA (try 3.2.3.GA for instance). This toImage()-approach is very useful to build images of the gui instead of having components (such as labels) rendered all the time. It makes the UI much snappier/performant and I use it alot. This is a complete stopper for me.
Sample Code
Titanium.UI.setBackgroundColor('#000');
var view= require('FirstView');
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
win1.add(view());
win1.open();
function FirstView() {
var buildView = Ti.UI.createView({
backgroundColor:'red',
width:100,
height:100
});
buildView.add(Ti.UI.createLabel({
backgroundColor:'yellow',
color:'#000000',
text:'ABC',
}));
var container = Ti.UI.createView({
width:100,
height:100,
backgroundImage: buildView.toImage()
});
return container;
}
module.exports = FirstView;
Steps to reproduce
- Create a new Project.
- Copy the "app.js" code to the project "app.js" file.
- Create a new file named "FirstView" in Projects Resource directory.
- Copy the "FirstView.js" code to the project "FirstView.js" file.
- Run the Project.
Actual results
OBSERVED PROBLEM
In SDK version 3.2.3.GA the label is shown where in SDK version 3.3.0.GA the label despaired. view.toImage() is not working in New SDK 3.3.0.GA
Yes I'm experiencing this problem too, toImage() doesn't render labels from SDK 3.3.0, the bug is still present in the new SDK 3.4.0
This error also occurs to me, as it occurred from version 3.3.0, and it is only to be fixed in version 3.5 which is scheduled for 19 / Mar / 2015. Would not be possible to place with the release of 3.4.2?
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/6302
PR merged.
Verified fix on: Mac OSX 10.10.1 Appcelerator Studio, build: 3.4.1.201410281743 Titanium SDK build: 3.6.0.v20150115142105 Titanium CLI, build: 3.4.1 Alloy: 1.5.1 Xcode 6.1.1 iPhone 6 Plus (8.1.1), iPad Air 2 (8.2b4) Using the attached code built to both devices, the labels are laid out correctly each time, added more views and the labels stayed in the correct position. Closing ticket.