yackle / CLImageEditor

MIT License
2.21k stars 573 forks source link

Space between toolBar item #49

Closed addel closed 10 years ago

addel commented 10 years ago

hi, i'm french so sorry for my bad english,

Your imageEditor is amazing, but i want to know how i can put a space between every item toolbar because for an application for my final school test i would like to use juste 3 item and that 3 item take all toolBar, so i need some space,

thank you very much, merci beaucoup ciao

yackle commented 10 years ago

There is no way to put spaces easily. You should hack the code yourself. In particular, you will need to modify - (void)setMenuView in _CLImageEditorViewController.m.

addel commented 10 years ago

Hi, i'm back with an echec statut lol, i did not fine a solution but i tried and tried again, could you please help me and i swear ... i call you iOS master until i'm alive !!! and if you want a place in paris your welcome. please please thank you a lot

yackle commented 10 years ago

Though I'm not sure how you want to layout, for example, replace setMenuView with following:

- (void)setMenuView
{
    CGFloat W  = 70;
    CGFloat H  = _menuView.height;
    CGFloat dx = (_menuView.width/3 - W)/2;
    CGFloat x  = dx;

    for(CLImageToolInfo *info in self.toolInfo.sortedSubtools){
        if(!info.available){
            continue;
        }

        CLToolbarMenuItem *view = [CLImageEditorTheme menuItemWithFrame:CGRectMake(x, 0, W, H) target:self action:@selector(tappedMenuView:) toolInfo:info];
        [_menuView addSubview:view];
        x += W + 2*dx;
    }
}

2014-07-03 10 45 57

addel commented 10 years ago

Thank you !!! Thank you a lot that work thank thank thank !!!!!