I'm using setBackgroundImage:forToolbarPosition:metrics: method of UIToolbar. That's my code:
toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0,0, 320, 44)];
[toolbar setBackgroundImage:[UIImage imageNamed:@"top"] forToolbarPosition:UIToolbarPositionTop barMetrics:UIBarMetricsDefault];
[toolbar setBackgroundImage:[UIImage imageNamed:@"bottom"] forToolbarPosition:UIToolbarPositionBottom barMetrics:UIBarMetricsDefault];
[self.view addSubview:toolbar];
As you can see I've put my toolbar on top. However when I run the code the toolbar image used is [UIImage imageNamed:@"bottom"].
How UIToolbarPosition is obtained? My first idea is frame check ( < 1/2 superview frame is top, otherwise is bottom... or sort of).
It still on bottom. Any idea?