标签:blog io ar os sp for on div log
//- (void)setBackgroundImage:(UIImage *)backgroundImage forBarMetrics:(UIBarMetrics)barMetrics NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; -(id)init { self=[super init]; if(self) { UINavigationBar *navBar=[self navigationBar]; if([navBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)]) { //如果是IOS5 [[UINavigationBar appearance]setBackgroundImage:[UIImage imageNamed:@"NavBar.png"] forBarMetrics:UIBarMetricsDefault]; } else { UIImageView *imgView=(UIImageView*)[navBar viewWithTag:NAVBARIMAGETAG]; if(imgView==nil) { imgView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0,navBar.frame.size.width, navBar.frame.size.height)]; [imgView setImage:[UIImage imageNamed:@"NavBar.png"]]; [navBar insertSubview:imgView atIndex:0]; [imgView release]; } } } return self; }
标签:blog io ar os sp for on div log
原文地址:http://www.cnblogs.com/lgphp/p/4109556.html