[TIMOB-18245] Ti.Media.takeScreenshot() does not render the selected iOS TabbedBar element
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-02-11T16:22:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.0.0 |
Components | iOS |
Labels | ios, module_media, qe-manualtest |
Reporter | Malcolm Hollingsworth |
Assignee | Chee Kiat Ng |
Created | 2014-12-16T14:46:47.000+0000 |
Updated | 2015-02-17T05:36:48.000+0000 |
Description
The method *Ti.Media.takeScreenshot()* does not render the selected iOS TabbedBar element.
If an *iOS TabbedBar* is displayed on a device with at least one selected entry visible the text of the selected entry will NOT render when the *takeScreenshot* method is called and the resulting image is displayed or stored in the file system.
The problem exists on Ti SDK 3.4.1 and Ti SDK 3.5.0 beta on iOS simulators 7.1 and 8.1 in all of the devices size variations.
var win = Ti.UI.createWindow({
backgroundColor: 'red'
});
var fileName = 'testme.png';
var bb1 = Titanium.UI.createTabbedBar({
labels: ['One', 'Two', 'Three'],
backgroundColor: '#336699',
top: 50,
style: Titanium.UI.iPhone.SystemButtonStyle.BAR,
height: 25,
width: 200,
bubble: false
});
win.add(bb1);
win.addEventListener('click', function(e) {
Ti.Media.takeScreenshot(function(e) {
var file = Ti.Filesystem.getFile(Ti.Filesystem.getTempDirectory(), fileName);
Ti.API.info(fileName + ': ' + file.resolve());
file.write(e.media);
file = null;
});
});
win.add(bb1);
The problem occurs using both Alloy or non-alloy - obvious but ruled out anyway.
Confirmation (and simple code snippet) provided by Stephen Feather.
Attachments
File | Date | Size |
---|---|---|
alloyversion.png | 2014-12-16T14:46:47.000+0000 | 8252 |
testme.png | 2014-12-16T14:46:47.000+0000 | 22040 |
Updated sample code here:
Changes made:
- Replace deprecated Ti.UI.tabbedbar with Ti.UI.iOS.tabbedbar. - Removed deprecated Ti.UI.iPhone.SystemButtonStyle.BAR. - Used dblclick instead of click event to capture screenshotPR Here: https://github.com/appcelerator/titanium_mobile/pull/6638
The selected tab in tabbed bar is rendered in the screenshot through Ti.Media.takeScreenshot Verified on: Appc Studio: 4.0.0.201502111039 Titanium SDK: 4.0.0.v20150216083136 Xcode: 6.1, 6.2 beta Device: iOS Simulator v8.1, v8.2 beta, iPhone 4 (v7.1), iPhone 5S (v8.1)