Coder Social home page Coder Social logo

navigationmenu's Introduction

[DEPRECATED] Navigation Menu for iOS

Version 1.0

Navigation Menu is an Objective-C component that adds possibility to show menu from navigation bar. Inspired by Vkontakte app. Minimum iOS target is 5.0

TODO: add Pod

Customization

  • Menu item height + (float)itemCellHeight;
  • Animation duration of menu appearence + (float)animationDuration;
  • Menu substrate alpha value + (float)backgroundAlpha;
  • Menu alpha value + (float)menuAlpha;
  • Value of bounce + (float)bounceOffset;
  • Arrow image near title *+ (UIImage )arrowImage;
  • Distance between Title and arrow image + (float)arrowPadding;
  • Items color in menu *+ (UIColor )itemsColor;
  • Menu color *+ (UIColor )mainColor;
  • Item selection animation speed + (float)selectionSpeed;
  • Menu item text color *+ (UIColor )itemTextColor;
  • Selection color (will create a gradiend with provided color at the top and 35% darker in the bottom) *+ (UIColor )selectionColor;

Example

//In your header (.h) file
#import "SINavigationMenuView.h"

@interface HAViewController : UIViewController <SINavigationMenuDelegate>

@end

//In your implementation (.m) file
- (void)viewDidLoad
{
	[super viewDidLoad];
	// check if we have a navigationItem
	if (self.navigationItem) {
    	CGRect frame = CGRectMake(0.0, 0.0, 200.0, self.navigationController.navigationBar.bounds.size.height);
    	SINavigationMenuView *menu = [[SINavigationMenuView alloc] initWithFrame:frame title:@"Menu"];
    	//Set in which view we will display a menu
    	[menu displayMenuInView:self.view];
    	//Create array of items
    	menu.items = @[@"News", @"Top Articles", @"Messages"];
    	menu.delegate = self;
    	self.navigationItem.titleView = menu;
	}
}

//Delegate method
- (void)didSelectItemAtIndex:(NSUInteger)index
{
	NSLog(@"did selected item at index %d", index);
}

You will need to add QuartzCore framework. This component use ARC. For cusomization see SIMenuConfiguration .h/.m files.

navigationmenu's People

Contributors

isapozhnik avatar shmidt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

navigationmenu's Issues

iOS version above 6โ€ฆ

NavigationMenu needs to be reworked to work properly on iOS "next". It does not show in the proper location, and the coloring is all screwed up.

Change itemCellHeight causes scroll issues.

Steps to Reproduce:
-> Add enough items so that it is larger than the size of the screen.
-> Change itemCellHeight to something lesser than 44.0f. Let's say 30.0f
-> Run App, try scrolling. I does not scroll.

Pod

Pod heavily needs to be created.

iPad issue on selection, only half of the cell background is changed

I am using this project for iPad project, however on selection of menu item, only half of the cell background is changed. Please find image

navigation-menu-cell-selection

This occurs at SIMenuCell->initWithStyle where size width is 320(iPhone) but it should be 768(iPad). I tried to fix but not sure where exactly width is set.
I did a little hack by modifying width

CGRect bound = CGRectMake(self.bounds.origin.x, self.bounds.origin.y, 768, self.bounds.size.height);
self.cellSelection = [[SICellSelection alloc] initWithFrame:bound andColor:[SIMenuConfiguration selectionColor]];

How to make Triangle Image Touchable

as a user experience user always touch on triangle image to drop down tableview. can you please let me know how to increase touchable area till the triangle image.

Flashing white line

running in ios 7 and i can see flashing white line when the menu show and hide
the white line is near around the separator even though separator is set to none in the navigationmenu code

Scrolling Problems

I can't scroll my UIViewController, in the portion that the menu covers (even when the menu is hidden), I can still scroll in the region that the menu does not cover.

This is quite a hindrance to the user experience.

Does anyone know how to solve this bug?

Closing menu programmatically

Hey, dear Ivan @iSapozhnik . How are u? :)
Help me to solve this issue. I found a method in SIMenuTable "- (void)hide;"
How can i call it? Here is my init code

if (self.navigationItem) {
CGRect frame = CGRectMake(0.0, 0.0, 200.0, self.navigationController.navigationBar.bounds.size.height);
NSString *firstCategoryTitle = ((CategoryClass *)[categories objectAtIndex:0]).categoryName;

        SINavigationMenuView *menu = [[SINavigationMenuView alloc] initWithFrame:frame title:firstCategoryTitle];
        //Set in which view we will display a menu
        [menu displayMenuInView:self.view];
        //Create array of items
        NSMutableArray *ar = [[NSMutableArray alloc] init];

        for (CategoryClass *cc in categories) {
            [ar addObject:cc.categoryName];
        }

        menu.items = [NSArray arrayWithArray:ar];
        menu.delegate = self;

        self.navigationItem.titleView = menu;
    }

MenuButton to the Right

First of all, thanks for this incredible menu.
But i have a problem.
I want to move the MenuButton to the right at the navigation controller, but when i do the seleccion of the button is quite minimal and only the menu is displayed from the beginning of the frame

I made the modification in the HAViewController.m in this part:

  • (void)viewDidLoad
    {
    [super viewDidLoad];
    if (self.navigationItem) {
    CGRect frame = CGRectMake(100.0, 0.0, 120.0, self.navigationController.navigationBar.bounds.size.height);

It's possible to do this with your menu?

Greetings and sorry for my bad english.

License?

What licensing do you have for this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.