0
votes

I'm currently trying to add AwesomeMenu on top of a MapView. The mapview is loaded via Storyboard and the AwesomeMenu is created in the "viewDidLoad" method of the view controller and then added as subview. In this way AwesomeMenu doesn't show on the view, is there a particular problem on adding subviews to MKMapView? Any clue?

-(void)viewDidLoad
{
    CLLocation *turin = [[CLLocation alloc] initWithLatitude:45.071274 longitude:7.684910];
    MKCoordinateRegion region =
    MKCoordinateRegionMakeWithDistance (
                                    turin.coordinate, 1000, 1000);
    [mapView setRegion:region animated:NO];
    [switcher addTarget:self action:@selector(populateMap:) forControlEvents:UIControlEventValueChanged];
    menu = [[AwesomeMenu alloc] initWithFrame:self.mapView.frame
                                                 menus:nil];
    [self.mapView addSubview:menu];
}

Thanks in advance ...

1

1 Answers

2
votes
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    UIImage *storyMenuItemImage = [UIImage imageNamed:@"bg-menuitem.png"];
    UIImage *storyMenuItemImagePressed = [UIImage imageNamed:@"bg-menuitem-highlighted.png"];
    UIImage *starImage = [UIImage imageNamed:@"icon-star.png"];


    AwesomeMenuItem *starMenuItem1 = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
                                                           highlightedImage:storyMenuItemImagePressed
                                                               ContentImage:starImage
                                                    highlightedContentImage:nil];

    NSArray *menuOptions = [NSArray arrayWithObjects:starMenuItem1 , nil];
    AwesomeMenu *menu = [[AwesomeMenu alloc] initWithFrame:self.view.frame
                                                     menus: menuOptions];

    [self.view addSubview:menu];
}