0

I'm looking to convert my standard UIToolbar (Opaque black with text based buttons), to something a little more graphical. Probably something like the following (taken from a Blackberry app):

enter image description here

Would this go against the human interface guidelines? I've seen this type of customization done for the UITabbar before but never for the UIToolbar. If I have an EDIT button that performs basic EDIT taskes like allowing me to delete a row in a table. How would Apple feel if I had my own EDIT graphic like above??

Also, instead of creating my own UIToolbar or subclassing UIToolbar and modifying it to fit my needs, couldn't I just put a bunch of UIButtons in a row side by side with custom graphics to look like a toolbar??

PaulG
  • 6,920
  • 12
  • 54
  • 98

2 Answers2

1

There wont be any problem with apple access, you dont have to subclassing anything just put other component to your toolbar:

-(UIToolbar *) toolBarActive {
if( _toolBarActive == nil ) {
    _toolBarActive = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 360, 320, 60)];
    [_toolBarActive setBackgroundImage:[UIImage imageNamed:@"image.png"] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
    _toolBarActive.tintColor = [UIColor blackColor];  
    [_toolBarActive setBackgroundColor:[UIColor blackColor]];
    UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
    NSMutableArray *arrayItem = [[NSMutableArray alloc] init];
    [arrayItem addObject:flexibleSpace];
    [arrayItem addObject:self.buttonItem1];
    [arrayItem addObject:flexibleSpace];
    [arrayItem addObject:self.buttonItem2];
    [arrayItem addObject:flexibleSpace];
    [arrayItem addObject:self.buttonItem3];
    [arrayItem addObject:flexibleSpace];
    [arrayItem addObject:self.buttonItem4];
    [arrayItem addObject:flexibleSpace];
    [_toolBarActive setItems:arrayItem animated:YES];
}
return _toolBarActive;

}

Where for example buttonItem1 define as:

- (UIBarButtonItem *) buttonItem1 {
    if( _buttonItem1 == nil ) {
        _uttonItem1 = [[UIBarButtonItem alloc] initWithCustomView:self.button1];
        [_buttonItem1 setEnabled:YES];
        [_buttonItem1 setBackgroundVerticalPositionAdjustment:100.0f forBarMetrics:UIBarMetricsDefault];
    }
    return _buttonItem1;
}

and button1 define as:

 - (UIButton *) button1 {
    if( _button1 == nil ) {
        _button1 = [[UIButton alloc] initWithFrame:CGRectMake(5, 5, 50, 50)];
        [_button1 addTarget:self action:@selector(addNewImage) forControlEvents:UIControlEventTouchUpInside];
        [_button1 setImage:[UIImage imageNamed:@"image.png"] forState:UIControlStateNormal];
    }
    return _button1;
}
edzio27
  • 4,126
  • 7
  • 33
  • 48
0

I think you have to ensure the Guidelines of apple are followed when customizing. Else they will reject.

You can see the Toolbar Guidelines here Section:Bars-->Toolbar

Shamsudheen TK
  • 30,739
  • 9
  • 69
  • 102