alattis / ALRadial

a clone of the path radial button menu control
183 stars 55 forks source link

Help with icons being cut off #11

Closed KyleGreenlaw closed 11 years ago

KyleGreenlaw commented 11 years ago
- (IBAction)buttonPressed:(id)sender {

    [self.socialMenu buttonsWillAnimateFromButton:sender withFrame:self.socialButton.frame inView:self.navigationController.view];
}

I set this to "self.navigationController.view" because it is in a table view and i need it to overlay it, not slide with it. The only thing is then this happens : ios simulator screen shot 2013-05-17 11 25 19 am

See at the top, that is what is happening... Heres the rest of my code for ALRadcial..

- (UIImage *) radialMenu:(ALRadialMenu *)radialMenu imageForIndex:(NSInteger) index {
if (radialMenu == self.socialMenu) {
    if (index == 1) {
        return [UIImage imageNamed:@"Home"];
    } else if (index == 2) {
        return [UIImage imageNamed:@"Information"];
    } else if (index == 3) {
        return [UIImage imageNamed:@"Tutorial"];
    } else if (index == 4) {
        return [UIImage imageNamed:@"Feedback"];
    }
}

    return nil;
}

- (void) radialMenu:(ALRadialMenu *)radialMenu didSelectItemAtIndex:(NSInteger)index {
if (radialMenu == self.socialMenu) {
    [self.socialMenu itemsWillDisapearIntoButton:self.socialButton];
    if (index == 1) {
        NSLog(@"Home");
    } else if (index == 2) {
        UIViewController *second = [self.storyboard instantiateViewControllerWithIdentifier:@"Information"];

        [self.navigationController presentViewController:second animated:NO completion:nil];
        NSLog(@"Information");
    } else if (index == 3) {
        UIViewController *second = [self.storyboard instantiateViewControllerWithIdentifier:@"Tutorial"];

        [self.navigationController presentViewController:second animated:NO completion:nil];            NSLog(@"Tutorial");
    } else if (index == 4) {
        UIViewController *second = [self.storyboard instantiateViewControllerWithIdentifier:@"Feedback"];

        [self.navigationController presentViewController:second animated:NO completion:nil];            NSLog(@"Feedback");
    }
}

}

#pragma mark - radial menu delegate methods
- (NSInteger) numberOfItemsInRadialMenu:(ALRadialMenu *)radialMenu {
//FIXME: dipshit, change one of these variable names
if (radialMenu == self.socialMenu) {
    return 4;
}

return 0;
}

- (NSInteger) arcSizeForRadialMenu:(ALRadialMenu *)radialMenu {
if (radialMenu == self.socialMenu) {
    return 90;
}

return 0;
}

- (NSInteger) arcRadiusForRadialMenu:(ALRadialMenu *)radialMenu {
if (radialMenu == self.socialMenu) {
    return 80;
}

return 0;
}

- (void)viewDidLoad {
[super viewDidLoad];

self.socialMenu = [[ALRadialMenu alloc] init];
self.socialMenu.delegate = self;
}
alattis commented 11 years ago

you can control the placement of the first icon with the arcStartForRadialMenu delegate method

KyleGreenlaw commented 11 years ago

Sorry but how would I do this?

alattis commented 11 years ago

place this below arcRadiusForRadialMenu

- (NSInteger) arcStartForRadialMenu:(ALRadialMenu *)radialMenu {
return 5;
}

you probably also want to increase the value returned by arcRadiusForRadialMenu

KyleGreenlaw commented 11 years ago

Perfect, thank you :)