English 中文(简体)
采用统一意见(AwesomeMenu)—— 观点
原标题:Using UIView (AwesomeMenu) -> view doesn t appear

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.

最佳回答

您的意见认为,需要添加<代码>AwesomeMenu。 修改<代码>的结尾处:

    .......

    // Now, setup the menu and the options
    awesomeMenu = [[AwesomeMenu alloc] 
                  initWithFrame:self.view.bounds 
                  menus:[NSArray arrayWithObjects:starMenuItem1, starMenuItem2, nil]];
    awesomeMenu.delegate = self;

    [self.view addSubView:awesomeMenu] // <-- THIS ADDS THE AWESOME VIEW TO YOUR VIEWCONTROLLERS VIEW
    NSLog(@"initializeSpringMenu: Done initializing it");
}

这应该是所有。

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签