I am trying to place UIToolBar
in UINavigationBar
.
UIToolbar* tempFontSizeToolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(kPaginationToolBarOriginX,kPaginationToolBarOriginY,kPaginationToolBarWidth,kPaginationToolBarHeight)];
tempFontSizeToolBar.backgroundColor = [UIColor clearColor];
// create the array to hold the buttons, which then gets added to the toolbar
NSMutableArray* buttons = [[NSMutableArray alloc] init];
[tempFontSizeToolBar setTranslucent:YES];
UIBarButtonItem *fontSizeBarButtonItem;
fontSizeBarButtonItem = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:KpreviousPageIcon] style:UIBarButtonItemStylePlain target:self action:@selector(movePreviousPage:)];
[buttons addObject:fontSizeBarButtonItem];
[fontSizeBarButtonItem release];fontSizeBarButtonItem = nil;
fontSizeBarButtonItem = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:KnextpageIcon] style:UIBarButtonItemStylePlain target:self action:@selector(moveNextPage:)];
[buttons addObject:fontSizeBarButtonItem];
[fontSizeBarButtonItem release];fontSizeBarButtonItem = nil;
// stick the buttons in the toolbar
[tempFontSizeToolBar setItems:buttons animated:NO];
[buttons release];buttons = nil;
UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithCustomView:tempFontSizeToolBar];
self.navigationItem.rightBarButtonItem = rightBarItem;
The background color of that UIToolBar
is the default Blue.
But I need the Toolbar should be in clear color so that the NavigationBar's background image should appear in that Toolbar also.
Pls suggest me.