Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1670] iOS: Button image does not show title when button is in a toolbar

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-07-25T16:07:10.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsapi
Reporterctredway
AssigneeNeeraj Gupta
Created2011-04-15T02:58:57.000+0000
Updated2012-07-26T22:23:45.000+0000

Description

The following code does not show the title when a button in toolbar also has an image. iOS 4, sdk 1.4 & newer 1.4.1 build

var win = Titanium.UI.currentWindow;

// initialize to all modes win.orientationModes = [

Titanium.UI.PORTRAIT,
Titanium.UI.LANDSCAPE_LEFT,
Titanium.UI.LANDSCAPE_RIGHT

];

var flexSpace = Titanium.UI.createButton({

systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE

});

var change = Titanium.UI.createButton({

image:'button.png',
title:'Change Toolbar',

// style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED,

width:100,
height:35

});

var revert = Titanium.UI.createButton({

title:'Revert Toolbar',
style:Titanium.UI.iPhone.SystemButtonStyle.DONE

});

// // Toolbar 2 // var toolbar2 = Titanium.UI.createToolbar({

items:[change,flexSpace,revert],
top:130,
borderTop:false,
borderBottom:false,
barColor:'#336699'

});

change.addEventListener('click', function()
{

toolbar2.borderTop = false;
toolbar2.borderBottom = false;
toolbar2.translucent = true;
toolbar2.barColor = '#000';
toolbar2.width = 300;

change.width = "160";
change.title = "Change Toolbar (!)";

});

revert.addEventListener('click', function()
{

toolbar2.borderTop = true;
toolbar2.borderBottom = true;
toolbar2.barColor = '#336699';
toolbar2.width = null;

change.width = 0; // 0 means auto
change.title = "Change Toolbar";

});

win.add(toolbar2);

Attachments

FileDateSize
button.png2011-04-15T02:58:57.000+0000530

Comments

  1. Stephen Tramer 2012-07-25

    Cannot be reproduced from sample app in SDK 2.2.0.f9e938d, iPhone Sim 5.1.

JSON Source