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;
}
UIToolBar 背景图片设置
最新推荐文章于 2022-09-24 15:58:02 发布