I have following code where in only search bar,fixedspacebar is visible on the toolbar but uitextfield is not visible.....
Also fixedspace bar should not be visible in runtime but it is visible and can be tapped as button....
Please suggest on this.....
Also fixedspace bar should not be visible in runtime but it is visible and can be tapped as button....
Code:
- (void)viewDidLoad {
[super viewDidLoad];
//self.view.backgroundColor =[UIColor blackColor];
toolBar =[[UIToolbar alloc]init];
srcBar = [[UISearchBar alloc] init];
txtPrice = [[UITextField alloc] init];
btnSearchBar = [[UIBarButtonItem alloc]initWithCustomView:srcBar];
btntxtPriceBar = [[UIBarButtonItem alloc]initWithCustomView:txtPrice];
fixedBar = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonSystemItemFixedSpace target:nil action:nil];
[txtPrice setPlaceholder:@"helloc"];
[toolBar setItems:[NSArray arrayWithObjects:btnSearchBar,btntxtPriceBar,fixedBar,nil]];
btnSearchBar.width = 200;
btntxtPriceBar.width = 200;
fixedBar.width = 410;
....
.....
...
}