UIToolBar 背景图片设置
UIToolbar *toolBar = [[[UIToolbar alloc]initWithFrame:CGRectMake(0, self.scrollView.frame.size.height, self.view.frame.size.width, 30)] autorelease];
UIImage *root_image = [UIImage imageNamed:@"toolbarBackground.png"];
if ([toolBar respondsToSelector:@selector(setBackgroundImage:forToolbarPosition:barMetrics:)]) {
[toolBar setBackgroundImage:root_image forToolbarPosition:0 barMetrics:0]; //仅5.0以上版本适用
}else{
toolBar.barStyle = UIToolbarPositionTop;
}

浙公网安备 33010602011771号