I tried using AwesomeMenu in my code, the one which is here: https://github.com/levey/AwesomeMenu
它的用法非常简单,见于厚生页。 我认为这是事实。 但是,这股菜单并没有出现在国库中。 采用SOS5.0和Xcode 4.2,与Siulator一起测试。
这是我做的:
in my ViewController.h
...
#import "AwesomeMenu.h"
#import "AwesomeMenuItem.h"
...
// I included the AwesomeMenuDelegate here
@interface com_FirstViewController : UIViewController <UITableViewDelegate, UITableViewDataSource,AwesomeMenuDelegate> {
...
}
@property (nonatomic, retain) IBOutlet AwesomeMenu *awesomeMenu;
...
In the Storyboard I have created a UIView instance, positioned & resized it where I want it to, changed its class to type AwesomeMenu , and linked its Referencing Outlet to the IBOutlet property awesomeMenu .
www.un.org/spanish/ecosoc In ViewController.m
...
@synthesize awesomeMenu;
...
AwesomeMenuItem *starMenuItem1;
AwesomeMenuItem *starMenuItem2;
...
...
// This method seems to be getting called, as I see the log messages
-(void) initializeSpringMenu {
NSLog(@"InitializeSpringMenu: entered");
UIImage *storyMenuItemImage = [UIImage imageNamed:@"GooglePlus.png"];
UIImage *storyMenuItemImagePressed = [UIImage imageNamed:@"GooglePlus.png"];
UIImage *starImage = [UIImage imageNamed:@"Mail-icon.png"];
starMenuItem1 = [[AwesomeMenuItem alloc]
initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
starMenuItem2 = [[AwesomeMenuItem alloc]
initWithImage:storyMenuItemImage
highlightedImage:storyMenuItemImagePressed
ContentImage:starImage
highlightedContentImage:nil];
// Now, setup the menu and the options
awesomeMenu = [[AwesomeMenu alloc]
initWithFrame:self.view.bounds
menus:[NSArray arrayWithObjects:starMenuItem1, starMenuItem2, nil]];
awesomeMenu.delegate = self;
NSLog(@"initializeSpringMenu: Done initializing it");
}
- (void)viewDidLoad {
...
[self initializeSpringMenu];
...
}
I think it s pretty straightforward & I don t see what am missing here. Is it the bounds when doing an init of AwesomeMenu? Can someone please help? The view appears blank in the UI when I run the App.