[TIMOB-13528] iOS: Regression in behaviour with custom views on {right,left} NavButton for iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-04-11T21:03:59.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 08 API, 2013 Sprint 08, Release 3.2.0 |
Components | iOS |
Labels | module_navwindow, navbar, qe-closed-3.1.0, qe-testadded, regression, triage |
Reporter | Pier Paolo Ramon |
Assignee | Vishal Duggal |
Created | 2013-04-11T12:30:12.000+0000 |
Updated | 2014-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();
There's actually a "work around", which is to change the view's
width
fromTi.UI.SIZE
to"auto"
.Tested and confirmed regression on iOS 6 simulator between Ti SDK 3.0.2 GA and latest 3.1 CI.
Pull pending https://github.com/appcelerator/titanium_mobile/pull/4146
Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/4147
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.
Guys, you are on fire! Thank you!