[TIMOB-7120] iOS: ButtonBar, TabbedBar don't accept Blob images
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-04-19T09:11:24.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.0.2 |
Components | iOS |
Labels | api, parity |
Reporter | Arthur Evans |
Assignee | jithinpv |
Created | 2012-01-11T22:32:15.000+0000 |
Updated | 2017-03-17T18:35:43.000+0000 |
Description
According to the button bar doc, you can use either a path or a Blob to specify an image for a
button bar (and presumably tabbed bar) button. However, this doesn't seem to work. Given the following code:
{code>
var imgFile = Titanium.Filesystem.getFile('KS_nav_views.png');
if (! imgFile.exists() )
{ alert("Couldn't open image file.")}
else
{
Ti.API.info("imgFile is: " + imgFile);
}
var imgBlob = imgFile.read();
Ti.API.info("image blog size is: " + imgBlob.height + "x" + imgBlob.width);
bb2 = Ti.UI.iOS.createTabbedBar({
labels : [ { title: "One", image: "KS_nav_ui.png" }, { image: imgBlob }],
backgroundColor : 'green',
style : Ti.UI.iPhone.SystemButtonStyle.PLAIN,
bottom : 100,
height : 60
});
```
I would expect to see images on both buttons, but only the first one appears. From the log statements,
it appears that the blob is OK, but no image shows up on the second button.
Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
use this code: var win = Ti.UI.createWindow({ backgroundColor: 'white', exitOnClose: true, fullscreen: false, layout: 'vertical', title: 'Label Demo' }); var imgFile = Titanium.Filesystem.getFile('KS_nav_views.png'); if (! imgFile.exists() ) { alert("Couldn't open image file.")} else { Ti.API.info("imgFile is: " + imgFile); } var imgBlob = imgFile.read(); Ti.API.info("image blog size is: " + imgBlob.height + "x" + imgBlob.width); bb2 = Ti.UI.iOS.createTabbedBar({ labels : [ { title: "One", image: "KS_nav_ui.png" }, { image: imgBlob }], backgroundColor : 'green', style : Ti.UI.iPhone.SystemButtonStyle.PLAIN, bottom : 100, height : 60 }); win.add(bb2); win.open();
Closing ticket as the issue cannot be reproduced.