view · edit · sidebar · attach · print · history

20130805-create-snap-option-view-for-generikacc-app

<< | Index | >>


Summary

  • Create Settings icon button and navigation.
  • Create Settings modal View for search options.

Commits / Patches

Index / Status


Create-option-view-button

  • Add toolbor for "Settings" menu icon.
  • Create modal view for Option view

UIBarButtonSystemItem

Constants list

Font Awesome

  // Button
  UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  button.frame = CGRectMake(0, 0, 60, 40);
  UIFont *font = [UIFont fontWithName:@"FontAwesome" size:14.0];
  [button.titleLabel setFont:font];
  [button setTitle:@"\uF013" forState:UIControlStateNormal]; // cog icon
  [button addTarget:self action:@selector(foo:) forControlEvents:UIControlEventTouchUpInside];

  // add to toolbarItems
  UIBarButtonItem *settingsBarButton = [[UIBarButtonItem alloc] initWithCustomView:button];
  self.toolbarItems = [NSArray arrayWithObjects:settingsBarButton, nil];

UILabel

UILabel does not have setTitle:forState method.
UIButton has textLabel after iOS 3.0.
But textLabel's title does not show any text (Use UIButton's setTitle:forState instead of this property)

FixedSpace with minus value

Toolbar of NavigationController has some magin.
Then used FixedSpace of last item in toolbar.

 UIBarButtonItem *margin = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
                                                                         target:nil
                                                                         action:nil];
  margin.width = -12;

Links

References of UIKit (UIBarButtonItem, UIButton, UILabel)


Create settings view

link

Create ModalView as NavigationController

 _settings = [[SettingsViewController alloc] init];
  _settings.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
  UINavigationController *settingsNavigation = [[UINavigationController alloc] initWithRootViewController: _settings];
  [self presentModalViewController:settingsNavigation animated:YES];
view · edit · sidebar · attach · print · history
Page last modified on August 05, 2013, at 10:45 AM