When I am putting two right bar buttons in my navigation bar at that time those two buttons are visible but they have a top border means I don’t want that border.
I am creating those buttons in my frame and assigning that frame to the navigation bar. How do I hide that frame border?
My code is as below:
UIBarButtonItem *btnAdd = [[UIBarButtonItem alloc] initWithTitle:@"Add"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(Add)];
UIBarButtonItem *btnEdit = [[UIBarButtonItem alloc] initWithTitle:@"Edit"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(Edit)];
UIToolbar *rightToolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 100, 46)];
rightToolBar.backgroundColor = [UIColor clearColor];
rightToolBar.tintColor = [UIColor colorWithRed:40.0/255.0 green:48.0/255.0 blue:51.0/255.0 alpha:0.0];
NSArray *buttonsRight = [NSArray arrayWithObjects:btnEdit, btnAdd, nil];
[rightToolBar setItems:buttonsRight];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightToolBar];
Use this
instead of using