i addded UIBarButtonItem *addBarButton=[[UIBarButtonItem alloc] >initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertData)]; in the toolbar but + button is not getting proper alignment ?
1
votes
Please explain your problem in detail.
– Irfan
actually i created a custom toolbar and added uibarbuttonitem (addbarbutton ) and self.editbarbutton item okk... edit button is appeared middle of the toolbar but addbarbutton is appeared in lower part of toolbar so here my code of uibarbuttonitem
– Shobhakar Tiwari
UIBarButtonItem *addBarButton=[[UIBarButtonItem alloc] >initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertData)];
– Shobhakar Tiwari
So you are facing this problem in which iOS?
– Irfan
1 Answers
0
votes
Add two UIBarButtonSystemItemFlexibleSpace items to your toolbar, to the left and right of your items
UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
[toolbar setItems:[NSArray arrayWithObjects:flexibleSpace, settingsButton,deleteButton,addButton, flexibleSpace, nil]];
[flexibleSpace release];
Adding these as you would any other toolbar items will distribute space evenly between the two of them
Hope this will help you.