86
You don“t have to add two buttons. You just need to add
UIBarButtonSystemItemFlexibleSpace
not
UIBarButtonSystemItemFixedSpace
and a button, so that it will be on right side.
Like this:
UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 40)];
toolbar.barStyle = UIBarStyleBlackTranslucent;
UIBarButtonItem *spaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
UIBarButtonItem *infoButtonItem1 = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(empresaTextFieldDone)];
toolbar.items = [NSArray arrayWithObjects: spaceButton, infoButtonItem1, nil];