GitHub Issue | n/a |
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-04-08T21:08:15.000+0000 |
Affected Version/s | Release 3.1.3, Release 3.2.0 |
Fix Version/s | 2014 Sprint 07, 2014 Sprint 07 SDK, Release 3.3.0 |
Components | iOS |
Labels | module_navwindow, qe-closed-3.3.0, qe-testadded, supportTeam |
Reporter | Marco Cota |
Assignee | Vishal Duggal |
Created | 2013-12-27T16:18:23.000+0000 |
Updated | 2014-08-05T16:02:38.000+0000 |
Request
Since iOS 7 the left and right space in the NavButtons has been increased and this is causing that some apps have issues with the look and feel of their app, would be useful to the developers to be able to set this space in order to avoid issues with their design.
Native Workaround
There are some workaround in obj-C that allow the developer to play with negative spacers or imageInsets that allow them to preserve the original design.
Negative spacer
http://stackoverflow.com/questions/18914812/how-to-edit-empty-spaces-of-left-right-uibarbuttonitem-in-uinavigationbar-in-io
UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil action:nil];
negativeSpacer.width = -16;// it was -6 in iOS 6
[self.navigationItem setLeftBarButtonItems:[NSArray arrayWithObjects:negativeSpacer, requriedButton/*this will be the button which u actually need*/, nil] animated:NO];
imageInsets
http://stackoverflow.com/questions/18861201/uibarbuttonitem-with-custom-view-not-properly-aligned-on-ios-7-when-used-as-left
// Add your barButtonItem with custom image as the following
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStyleBordered target:self action:@selector(categoryButtonPressed)];
// set your custom image
[barButton setImage:categoryImage];
// finally do the magic
barButton.imageInsets = UIEdgeInsetsMake(0.0, -20, 0, 0);
Exposed new properties leftNavButtons and rightNavButtons on Ti.UI.Window Test case
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5570
Verified fix with below environment: Appc Studio: 3.3.0.201404211130 SDK build: 3.3.0.v20140423155715 acs: 1.0.14 npm: 1.3.2 alloy: 1.4.0-dev CLI: titanium-3.3.0-dev titanium-code-processor:1.1.1-beta1 Xcode: 5.1.1 Osx: Mavericks(10.9.2) Device: iPhone 5C (7.1) Able to set the empty spaces of left, right in Window NavButton. Hence closing the issue.