Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9942] animation and opacity prevents the button with backgroundImage from being showed correctly

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2012-07-17T16:21:44.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sSprint 2012-15 API
ComponentsiOS
Labelsapi
ReporterQing Gao
AssigneeVishal Duggal
Created2012-07-11T14:46:20.000+0000
Updated2013-03-13T19:00:39.000+0000

Description

Run the sample code below. Expected behavior: The "close" button shows up in the navigation bar. Actual behavior: The "close" button does not show up unless the height property of that button is set.
	var win = Ti.UI.createWindow({
		backgroundColor:'#ffffff'
	});
		
	
	var object = { parentView:Ti.UI.createView({ left:10, right:10, top:10, bottom:10, opacity:0.0 }) };
	var outScale = Ti.UI.create2DMatrix().scale(0.1);
	var inScale = Ti.UI.create2DMatrix().scale(1.0);

	var contentContainer = Ti.UI.createView({ left:20, right:20, top:20, bottom:20, borderRadius:10 });
	var navBar = Ti.UI.createView({ top:0, left:0, right:0, height:44});
	
	var navCloseBtn = Ti.UI.createButton({ right:10, width:58, backgroundImage:'ad-bar-close-btn.png' });
	
	//walk around with height property being set.
	//var navCloseBtn = Ti.UI.createButton({ right:10, width:58,height:41, backgroundImage:'ad-bar-close-btn.png' });

	var title = Ti.UI.createLabel({ text:"title", color:'#333', left:20, top:3, height:41 });

	object.parentView.transform = outScale;

	navBar.add(title);
	navBar.add(navCloseBtn);

	object.controllers = {
			show: function() {
				win.add(object.parentView);

				object.parentView.animate({ transform:inScale, opacity:1.0, duration:250 }, function(e) {					
	
				});
			}
	};

	contentContainer.add(navBar);
	object.parentView.add(contentContainer);
	win.add(object.parentView);
	
	object.controllers.show();
	
	win.open();

Comments

  1. Sabil Rahim 2012-07-17

    In 1_8_X undefined height followed fill behavior on buttons, since 2_0_X undefined height follows size behavior. To return to 1_8_X behavior explicitly set
       //ie.height:Ti.UI.FILL
       var navCloseBtn = Ti.UI.createButton({ right:10, width:58, backgroundImage:'default_app_logo.png',height:Ti.UI.FILL });
       
  2. Natalie Huynh 2012-12-04

    Invalid test case

JSON Source