Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-16094

iOS 7: Allow users to set negative spacer in Window NavButton

    Details

      Description

      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);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                mcota Marco Cota (Inactive)
                Reviewer:
                Pedro Enrique (Inactive)
              • Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration