Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13528] iOS: Regression in behaviour with custom views on {right,left} NavButton for iOS

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-04-11T21:03:59.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sRelease 3.1.0, 2013 Sprint 08 API, 2013 Sprint 08, Release 3.2.0
ComponentsiOS
Labelsmodule_navwindow, navbar, qe-closed-3.1.0, qe-testadded, regression, triage
ReporterPier Paolo Ramon
AssigneeVishal Duggal
Created2013-04-11T12:30:12.000+0000
Updated2014-06-19T12:43:25.000+0000

Description

Changing the hierarchy (or doing something that has this as a collateral effect) make the view set as rightNavButton centered in the navBar. Just launch the provided code both as 3.0 and 3.1. "Clicking" on the button on 3.0 will work correctly, on 3.1 will expose the issue.
Titanium.UI.setBackgroundColor('#000');

var nav = Ti.UI.createView({
	width: Ti.UI.SIZE,
	layout: 'horizontal'
});

var btn = Ti.UI.createButton({
	width: 40,
	left: 2,
	right: 2,
	image: 'KS_nav_views.png'
});

var toggle = true;

btn.addEventListener('click', function () {
	toggle = !toggle;
	btn.image = toggle ? 'KS_nav_views.png' : 'KS_nav_ui.png';
});

nav.add(btn);

var window = Ti.UI.createWindow({
	title: 'Example',
	rightNavButton: nav,
	navBarHidden: false,
	backgroundColor: 'white',
	modal: true
});

window.open();

Comments

  1. Pier Paolo Ramon 2013-04-11

    There's actually a "work around", which is to change the view's width from Ti.UI.SIZE to "auto".
  2. Daniel Sefton 2013-04-11

    Tested and confirmed regression on iOS 6 simulator between Ti SDK 3.0.2 GA and latest 3.1 CI.
  3. Vishal Duggal 2013-04-11

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/4146
  4. Vishal Duggal 2013-04-11

    Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/4147
  5. Olga Romero 2013-04-12

    Tested and verified fix with: Titanium Studio, build: 3.1.0.201304101819 SDK build: 3.1.0.v20130411153922 Device: iPhone5 iOS 6.1.3 iOS 6.1 Simulator The rightNavButton is NOT centered in the navBar.
  6. Pier Paolo Ramon 2013-04-12

    Guys, you are on fire! Thank you!

JSON Source