可以通过函数来调整subview的层次关系
例子代码如下:
//设置tabbarcontroller的tabbaritem图片的大小 UIImage *tabbarimage=[UIImage imageNamed:@"first.png"]; UIImageView *tabBarBackgroundImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0,self.tabBar.frame.size.width, self.tabBar.frame.size.height)]; //tabBarBackgroundImageView.contentMode = UIViewContentModeScaleAspectFit;//效果将按原图原来的比例缩放 tabBarBackgroundImageView.image =tabbarimage; [self.tabBar insertSubview:tabBarBackgroundImageView atIndex:1]; //atIndex决定你的图片显示在标签栏的哪一层
引用连接如下:
http://blog.csdn.net/zhuzhihai1988/article/details/7706752